35769-vm/db/migrate.php
Flatlogic Bot 3db6af498b 1
2025-11-15 23:25:15 +00:00

22 lines
590 B
PHP

<?php
require_once __DIR__ . '/config.php';
function run_migrations() {
try {
$pdo = db();
$migration_file = __DIR__ . '/migrations/001_create_users_table.sql';
if (file_exists($migration_file)) {
$sql = file_get_contents($migration_file);
$pdo->exec($sql);
echo "Migration '001_create_users_table.sql' applied successfully.\n";
} else {
echo "Migration file not found.\n";
}
} catch (PDOException $e) {
die("Migration failed: " . $e->getMessage() . "\n");
}
}
run_migrations();