reddy buddy

This commit is contained in:
Flatlogic Bot 2025-10-13 09:55:19 +00:00
parent f424a16609
commit ad06cfe250

View File

@ -13,11 +13,17 @@ try {
// Now connect to the newly created database // Now connect to the newly created database
$pdo = db(); $pdo = db();
// Execute the initial schema // Get all migration files and sort them
$sql = file_get_contents('db/migrations/001_initial_schema.sql'); $migration_files = glob('db/migrations/*.sql');
$pdo->exec($sql); sort($migration_files);
// Execute each migration
foreach ($migration_files as $file) {
$sql = file_get_contents($file);
$pdo->exec($sql);
}
echo "Database setup completed successfully."; echo "Database setup and all migrations completed successfully.";
} catch (PDOException $e) { } catch (PDOException $e) {
die("Database setup failed: " . $e->getMessage()); die("Database setup failed: " . $e->getMessage());
} }