feat: 为快捷指令添加变量功能

#57
This commit is contained in:
Baobhan Sith
2025-05-30 09:25:46 +08:00
parent e2d6dcb937
commit 807a48a7dd
14 changed files with 595 additions and 109 deletions
+11 -1
View File
@@ -123,7 +123,6 @@ const definedMigrations: Migration[] = [
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: `
@@ -297,6 +296,17 @@ const definedMigrations: Migration[] = [
return !jumpChainColumnExists || !proxyTypeColumnExists;
}
},
{
id: 10,
name: 'Add variables column to quick_commands table',
check: async (db: Database): Promise<boolean> => {
const columnAlreadyExists = await columnExists(db, 'quick_commands', 'variables');
return !columnAlreadyExists;
},
sql: `
ALTER TABLE quick_commands ADD COLUMN variables TEXT NULL;
`
}
];
/**
+1
View File
@@ -166,6 +166,7 @@ CREATE TABLE IF NOT EXISTS quick_commands (
name TEXT NULL, -- 名称可选
command TEXT NOT NULL, -- 指令必选
usage_count INTEGER NOT NULL DEFAULT 0, -- 使用频率
variables TEXT NULL,
created_at INTEGER NOT NULL DEFAULT (strftime('%s', 'now')),
updated_at INTEGER NOT NULL DEFAULT (strftime('%s', 'now'))
);