initial commit
This commit is contained in:
10
migrate.php
Normal file
10
migrate.php
Normal file
@@ -0,0 +1,10 @@
|
||||
<?php
|
||||
require_once 'db.php';
|
||||
$schema = file_get_contents('schema_v2.sql');
|
||||
try {
|
||||
$pdo->exec($schema);
|
||||
echo "Migration successful.";
|
||||
} catch(Exception $e) {
|
||||
// If columns already exist, sqlite throws exception. We can ignore it safely for alter table if rerun.
|
||||
echo "Migration finished (or already applied).";
|
||||
}
|
||||
Reference in New Issue
Block a user