fixing errors
Deploy / deploy (push) Successful in 38s

This commit is contained in:
2026-05-07 21:33:21 +02:00
parent bfa69f2a60
commit 8321e3b889
3 changed files with 10 additions and 5 deletions
+4 -4
View File
@@ -16,6 +16,7 @@ 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 '',
@@ -38,11 +39,10 @@ function migrate($db) {
role ENUM('admin','user') DEFAULT 'user',
created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP
)");
// Connect as root for schema changes
try {
$db->exec("CREATE TABLE IF NOT EXISTS node_notes (
node_id INT PRIMARY KEY,
notes TEXT DEFAULT ''
)");
$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) {
}
}