feat: 添加连接备注功能

This commit is contained in:
Baobhan Sith
2025-05-04 00:51:21 +08:00
parent 6724ec07dc
commit daf5711ee2
11 changed files with 55 additions and 9 deletions
@@ -107,6 +107,20 @@ const definedMigrations: Migration[] = [
);
`
}
,
{
id: 4,
name: 'Add notes column to connections table',
check: async (db: Database): Promise<boolean> => {
const notesColumnExists = await columnExists(db, 'connections', 'notes');
// Only run if the column does NOT exist
return !notesColumnExists;
},
sql: `
-- Add the notes column to the connections table, allowing NULL values
ALTER TABLE connections ADD COLUMN notes TEXT NULL;
`
},
// --- 未来可以添加更多迁移 ---
];
+1
View File
@@ -86,6 +86,7 @@ CREATE TABLE IF NOT EXISTS connections (
encrypted_passphrase TEXT NULL,
proxy_id INTEGER NULL,
ssh_key_id INTEGER NULL, -- 新增 ssh_key_id 列
notes TEXT NULL,
created_at INTEGER NOT NULL DEFAULT (strftime('%s', 'now')),
updated_at INTEGER NOT NULL DEFAULT (strftime('%s', 'now')),
last_connected_at INTEGER NULL,