From ad06cfe250e50ada46683c2189f59f275da0b202 Mon Sep 17 00:00:00 2001 From: Flatlogic Bot Date: Mon, 13 Oct 2025 09:55:19 +0000 Subject: [PATCH] reddy buddy --- setup.php | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) 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