From 304d8eeb8b75e08f34fa96be8bdf1f6181d03ec0 Mon Sep 17 00:00:00 2001 From: janis steiner Date: Thu, 7 May 2026 18:48:18 +0200 Subject: [PATCH] fix 500 --- backend/config/database.php | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/backend/config/database.php b/backend/config/database.php index d7e3453..608986d 100644 --- a/backend/config/database.php +++ b/backend/config/database.php @@ -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 + )"); } \ No newline at end of file