15 lines
443 B
PHP
15 lines
443 B
PHP
<?php
|
|
require_once __DIR__ . '/config.php';
|
|
|
|
try {
|
|
$migrations = glob(__DIR__ . '/migrations_*.sql');
|
|
sort($migrations);
|
|
foreach ($migrations as $migration) {
|
|
$sql = file_get_contents($migration);
|
|
db()->exec($sql);
|
|
echo "Executed migration: " . basename($migration) . "\n";
|
|
}
|
|
echo "Database setup successful.";
|
|
} catch (PDOException $e) {
|
|
echo "Error setting up database: " . $e->getMessage();
|
|
} |