Update: 2026-05-07 15:49:13

This commit is contained in:
Hamza-Ayed
2026-05-07 15:49:13 +03:00
parent 24ae4e2183
commit 3b5f490efc
17 changed files with 889 additions and 6 deletions

22
scratch/run_migration.php Normal file
View File

@@ -0,0 +1,22 @@
<?php
require 'app/bootstrap.php';
$sql = file_get_contents('scratch/stage0_db_update.sql');
$db = \App\Core\Database::getInstance()->getConnection();
try {
// MySQL PDO cannot run multiple statements with exec() sometimes depending on driver,
// so we split by semicolon and handle.
$statements = array_filter(array_map('trim', explode(';', $sql)));
foreach ($statements as $stmt) {
if (!empty($stmt)) {
$db->exec($stmt);
echo "Executed: " . substr($stmt, 0, 50) . "...\n";
}
}
echo "Migration completed successfully!\n";
} catch (Exception $e) {
echo "Migration failed: " . $e->getMessage() . "\n";
exit(1);
}