.
Deploy / deploy (push) Successful in 39s

This commit is contained in:
2026-05-07 21:28:32 +02:00
parent 2376ee98e7
commit bfa69f2a60
3 changed files with 3 additions and 4 deletions
+1
View File
@@ -420,6 +420,7 @@ function handleNodes($method, $id, $db) {
break; break;
case 'DELETE': case 'DELETE':
if ($id) { if ($id) {
$db->prepare("DELETE FROM node_notes WHERE node_id = ?")->execute([$id]);
$db->prepare("DELETE FROM network_nodes WHERE id = ?")->execute([$id]); $db->prepare("DELETE FROM network_nodes WHERE id = ?")->execute([$id]);
echo json_encode(['deleted' => true]); echo json_encode(['deleted' => true]);
} }
+1 -2
View File
@@ -41,8 +41,7 @@ function migrate($db) {
try { try {
$db->exec("CREATE TABLE IF NOT EXISTS node_notes ( $db->exec("CREATE TABLE IF NOT EXISTS node_notes (
node_id INT PRIMARY KEY, node_id INT PRIMARY KEY,
notes TEXT DEFAULT '', notes TEXT DEFAULT ''
FOREIGN KEY (node_id) REFERENCES network_nodes(id) ON DELETE CASCADE
)"); )");
} catch (Exception $e) { } catch (Exception $e) {
} }
+1 -2
View File
@@ -73,6 +73,5 @@ INSERT IGNORE INTO teams (name, color) VALUES
-- Ensure notes column exists and grant ALTER privilege -- Ensure notes column exists and grant ALTER privilege
CREATE TABLE IF NOT EXISTS node_notes ( CREATE TABLE IF NOT EXISTS node_notes (
node_id INT PRIMARY KEY, node_id INT PRIMARY KEY,
notes TEXT DEFAULT '', notes TEXT DEFAULT ''
FOREIGN KEY (node_id) REFERENCES network_nodes(id) ON DELETE CASCADE
); );