@@ -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 '')");
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user