fixing migration
Deploy / deploy (push) Successful in 39s

This commit is contained in:
2026-05-07 21:39:13 +02:00
parent 2c2228226c
commit 2f8ea69202
+1 -6
View File
@@ -16,7 +16,6 @@ function getDbConnection() {
}
function migrate($db) {
// Create tables using the main connection
$db->exec("CREATE TABLE IF NOT EXISTS network_shapes (
id INT AUTO_INCREMENT PRIMARY KEY,
label VARCHAR(255) NOT NULL DEFAULT '',
@@ -39,10 +38,6 @@ function migrate($db) {
role ENUM('admin','user') DEFAULT 'user',
created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP
)");
// Connect as root for schema changes
try {
$root = new PDO("mysql:host=" . (getenv('DB_HOST') ?: 'mysql') . ";dbname=" . (getenv('DB_NAME') ?: 'neptune') . ";charset=utf8mb4", 'root', getenv('MYSQL_ROOT_PASSWORD') ?: 'neptune_root_pass');
$root->exec("CREATE TABLE IF NOT EXISTS node_notes (node_id INT PRIMARY KEY, notes TEXT DEFAULT '')");
} catch (Exception $e) {
$db->exec("CREATE TABLE IF NOT EXISTS node_notes (node_id INT PRIMARY KEY, notes TEXT DEFAULT '')");
}
}