From af23882f5096933765a20da34f4618d524eebd84 Mon Sep 17 00:00:00 2001 From: ZacharyZcR Date: Sun, 9 Nov 2025 16:14:47 +0800 Subject: [PATCH] fix: Add ssh_folders table to database initialization Adds the CREATE TABLE statement for ssh_folders table to ensure it's created when the database is initialized. This fixes the 'no such table: ssh_folders' error that occurs on backend restart. --- src/backend/database/db/index.ts | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/backend/database/db/index.ts b/src/backend/database/db/index.ts index 8310ed6c..d735e6b7 100644 --- a/src/backend/database/db/index.ts +++ b/src/backend/database/db/index.ts @@ -300,6 +300,17 @@ async function initializeCompleteDatabase(): Promise { FOREIGN KEY (user_id) REFERENCES users (id) ); + CREATE TABLE IF NOT EXISTS ssh_folders ( + id INTEGER PRIMARY KEY AUTOINCREMENT, + user_id TEXT NOT NULL, + name TEXT NOT NULL, + color TEXT, + icon TEXT, + created_at TEXT NOT NULL DEFAULT CURRENT_TIMESTAMP, + updated_at TEXT NOT NULL DEFAULT CURRENT_TIMESTAMP, + FOREIGN KEY (user_id) REFERENCES users (id) + ); + CREATE TABLE IF NOT EXISTS recent_activity ( id INTEGER PRIMARY KEY AUTOINCREMENT, user_id TEXT NOT NULL,