34681-vm/db/migrate.php
Flatlogic Bot 373e36aedb 0.1
2025-10-05 01:54:26 +00:00

16 lines
414 B
PHP

<?php
require_once __DIR__ . '/config.php';
try {
$pdo = db();
$sql = file_get_contents(__DIR__ . '/migrations/001_create_contact_submissions.sql');
if ($sql === false) {
throw new Exception("Failed to read migration file.");
}
$pdo->exec($sql);
echo "Migration applied successfully.\n";
} catch (Exception $e) {
echo "Error applying migration: " . $e->getMessage() . "\n";
}