.
Deploy / deploy (push) Successful in 39s

This commit is contained in:
2026-05-07 21:52:26 +02:00
parent 172b524e36
commit 36057b04a4
3 changed files with 9 additions and 26 deletions
+2 -4
View File
@@ -39,10 +39,8 @@ function migrate($db) {
created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP
)");
try {
$rootDb = new PDO("mysql:host=" . (getenv('DB_HOST') ?: 'mysql') . ";dbname=" . (getenv('DB_NAME') ?: 'neptune') . ";charset=utf8mb4", 'root', getenv('MYSQL_ROOT_PASSWORD') ?: 'neptune_root_pass');
$rootDb->exec("CREATE TABLE IF NOT EXISTS node_notes (id INT AUTO_INCREMENT PRIMARY KEY, node_id INT NOT NULL UNIQUE, notes TEXT DEFAULT '')");
$rootDb = new PDO("mysql:host=" . (getenv('DB_HOST') ?: 'mysql') . ";charset=utf8mb4", 'root', getenv('MYSQL_ROOT_PASSWORD') ?: 'neptune_root_pass');
$rootDb->exec("ALTER TABLE neptune.network_nodes ADD COLUMN IF NOT EXISTS notes TEXT DEFAULT '' AFTER group_name");
} catch (Exception $e) {
// Fallback: try with neptune user
$db->exec("CREATE TABLE IF NOT EXISTS node_notes (id INT AUTO_INCREMENT PRIMARY KEY, node_id INT NOT NULL UNIQUE, notes TEXT DEFAULT '')");
}
}