Phase 1 complete - API + Frontend deployed, DB migrated
This commit is contained in:
27
www/api.fahrschuldesk.de/bin/run_migration.php
Normal file
27
www/api.fahrschuldesk.de/bin/run_migration.php
Normal file
@@ -0,0 +1,27 @@
|
||||
#!/usr/bin/env php
|
||||
<?php
|
||||
/**
|
||||
* Migration Runner - Remote Version
|
||||
*/
|
||||
|
||||
echo "Starte Migration...\n";
|
||||
|
||||
try {
|
||||
$pdo = new PDO(
|
||||
'pgsql:host=10.255.30.11;port=5433;dbname=fahrschuldesk',
|
||||
'fahrschuldesk_api',
|
||||
'E8xP2mKjQ9nRtWsLvZ3bVc5YyH1sDe7f'
|
||||
);
|
||||
$pdo->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
|
||||
echo "✓ DB verbunden\n";
|
||||
|
||||
$sql = file_get_contents(__DIR__ . '/migration.sql');
|
||||
$pdo->exec($sql);
|
||||
echo "✓ Migration ausgeführt!\n";
|
||||
|
||||
} catch (PDOException $e) {
|
||||
echo "✗ Fehler: " . $e->getMessage() . "\n";
|
||||
exit(1);
|
||||
}
|
||||
|
||||
echo "Fertig!\n";
|
||||
Reference in New Issue
Block a user