From f300b9499ecbc9e21ef9422f6f81ab33182550c0 Mon Sep 17 00:00:00 2001 From: Chao Liu Date: Sat, 16 Aug 2025 13:34:36 +0800 Subject: [PATCH] feat: add AI settings database migration - Add ai_setting table schema for v0.26 - Support for MySQL, PostgreSQL, and SQLite databases Signed-off-by: Chao Liu --- store/migration/mysql/0.26/00__ai_setting.sql | 13 +++++++++++++ store/migration/postgres/0.26/00__ai_setting.sql | 14 ++++++++++++++ store/migration/sqlite/0.26/00__ai_setting.sql | 13 +++++++++++++ 3 files changed, 40 insertions(+) create mode 100644 store/migration/mysql/0.26/00__ai_setting.sql create mode 100644 store/migration/postgres/0.26/00__ai_setting.sql create mode 100644 store/migration/sqlite/0.26/00__ai_setting.sql diff --git a/store/migration/mysql/0.26/00__ai_setting.sql b/store/migration/mysql/0.26/00__ai_setting.sql new file mode 100644 index 000000000..ac0bf0bfb --- /dev/null +++ b/store/migration/mysql/0.26/00__ai_setting.sql @@ -0,0 +1,13 @@ +-- AI Setting Migration for MySQL +-- Add AI workspace setting support for 0.26 version + +-- No table changes needed as AI settings are stored in workspace_setting table +-- The workspace_setting table already exists and can handle JSON values + +-- Insert default AI setting if it doesn't exist +INSERT IGNORE INTO workspace_setting (name, value, description) +VALUES ( + 'workspace/settings/AI', + '{"enableAi":false,"baseUrl":"","apiKey":"","model":"","timeoutSeconds":15}', + 'AI configuration settings' +); \ No newline at end of file diff --git a/store/migration/postgres/0.26/00__ai_setting.sql b/store/migration/postgres/0.26/00__ai_setting.sql new file mode 100644 index 000000000..44bd3abdb --- /dev/null +++ b/store/migration/postgres/0.26/00__ai_setting.sql @@ -0,0 +1,14 @@ +-- AI Setting Migration for PostgreSQL +-- Add AI workspace setting support for 0.26 version + +-- No table changes needed as AI settings are stored in workspace_setting table +-- The workspace_setting table already exists and can handle JSON values + +-- Insert default AI setting if it doesn't exist +INSERT INTO workspace_setting (name, value, description) +VALUES ( + 'workspace/settings/AI', + '{"enableAi":false,"baseUrl":"","apiKey":"","model":"","timeoutSeconds":15}', + 'AI configuration settings' +) +ON CONFLICT (name) DO NOTHING; \ No newline at end of file diff --git a/store/migration/sqlite/0.26/00__ai_setting.sql b/store/migration/sqlite/0.26/00__ai_setting.sql new file mode 100644 index 000000000..269ea577e --- /dev/null +++ b/store/migration/sqlite/0.26/00__ai_setting.sql @@ -0,0 +1,13 @@ +-- AI Setting Migration +-- Add AI workspace setting support for 0.26 version + +-- No table changes needed as AI settings are stored in workspace_setting table +-- The workspace_setting table already exists and can handle JSON values + +-- Insert default AI setting if it doesn't exist +INSERT OR IGNORE INTO workspace_setting (name, value, description) +VALUES ( + 'workspace/settings/AI', + '{"enableAi":false,"baseUrl":"","apiKey":"","model":"","timeoutSeconds":15}', + 'AI configuration settings' +); \ No newline at end of file