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 <chaoliu719@gmail.com>
This commit is contained in:
Chao Liu 2025-08-16 13:34:36 +08:00 committed by ChaoLiu
parent 070598cbd3
commit f300b9499e
3 changed files with 40 additions and 0 deletions

View file

@ -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'
);

View file

@ -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;

View file

@ -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'
);