diff --git a/setup.php b/setup.php index 62c1461..a34aa9f 100644 --- a/setup.php +++ b/setup.php @@ -13,11 +13,17 @@ try { // Now connect to the newly created database $pdo = db(); - // Execute the initial schema - $sql = file_get_contents('db/migrations/001_initial_schema.sql'); - $pdo->exec($sql); + // Get all migration files and sort them + $migration_files = glob('db/migrations/*.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) { die("Database setup failed: " . $e->getMessage()); } \ No newline at end of file