22 lines
590 B
PHP
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();
|
|
|