fix 500
Deploy / deploy (push) Successful in 38s

This commit is contained in:
2026-05-07 18:48:18 +02:00
parent 26541f261c
commit 304d8eeb8b
+18
View File
@@ -10,6 +10,24 @@ function getDbConnection() {
PDO::ATTR_ERRMODE => PDO::ERRMODE_EXCEPTION,
PDO::ATTR_DEFAULT_FETCH_MODE => PDO::FETCH_ASSOC
]);
migrate($db);
}
return $db;
}
function migrate($db) {
$db->exec("CREATE TABLE IF NOT EXISTS network_shapes (
id INT AUTO_INCREMENT PRIMARY KEY,
label VARCHAR(255) NOT NULL DEFAULT '',
shape_type ENUM('rectangle','ellipse','zone') DEFAULT 'rectangle',
pos_x FLOAT DEFAULT 0,
pos_y FLOAT DEFAULT 0,
width FLOAT DEFAULT 200,
height FLOAT DEFAULT 150,
color VARCHAR(7) DEFAULT '#1e3a5f',
border_color VARCHAR(7) DEFAULT '#3b82f6',
opacity FLOAT DEFAULT 0.15,
z_index INT DEFAULT 0,
created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP
)");
}