34968-vm/db/run_migration.php
Flatlogic Bot ef71b241ae V8
2025-10-15 02:30:11 +00:00

18 lines
380 B
PHP

<?php
require_once 'config.php';
$migration_file = end($argv);
if (!file_exists($migration_file)) {
die("Migration file not found: $migration_file");
}
$sql = file_get_contents($migration_file);
$db = db();
try {
$db->exec($sql);
echo "Migration successful: $migration_file\n";
} catch (PDOException $e) {
die("Migration failed: " . $e->getMessage() . "\n");
}