From 01e68cce9bb5e40b0de2be0337b8ea605c630a98 Mon Sep 17 00:00:00 2001 From: janis steiner Date: Thu, 7 May 2026 21:12:34 +0200 Subject: [PATCH] fixing notes not being saved --- backend/api/index.php | 3 +++ backend/config/database.php | 5 +---- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/backend/api/index.php b/backend/api/index.php index f7037e1..b3b4e34 100644 --- a/backend/api/index.php +++ b/backend/api/index.php @@ -14,6 +14,9 @@ require_once __DIR__ . '/../config/database.php'; $db = getDbConnection(); +// Ensure notes column exists +try { $db->exec("ALTER TABLE network_nodes ADD COLUMN notes TEXT DEFAULT '' AFTER group_name"); } catch (Exception $e) {} + // Auth check (except for session check) $path = parse_url($_SERVER['REQUEST_URI'], PHP_URL_PATH); $path = str_replace('/api/', '', $path); diff --git a/backend/config/database.php b/backend/config/database.php index 58e3a52..9763434 100644 --- a/backend/config/database.php +++ b/backend/config/database.php @@ -39,10 +39,7 @@ function migrate($db) { created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP )"); try { - $r = $db->query("SHOW COLUMNS FROM network_nodes LIKE 'notes'"); - if ($r->rowCount() === 0) { - $db->exec("ALTER TABLE network_nodes ADD COLUMN notes TEXT DEFAULT '' AFTER group_name"); - } + $db->exec("ALTER TABLE network_nodes ADD COLUMN notes TEXT DEFAULT '' AFTER group_name"); } catch (Exception $e) { } } \ No newline at end of file