mirror of
https://github.com/usememos/memos.git
synced 2025-12-16 05:43:06 +08:00
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:
parent
070598cbd3
commit
f300b9499e
3 changed files with 40 additions and 0 deletions
13
store/migration/mysql/0.26/00__ai_setting.sql
Normal file
13
store/migration/mysql/0.26/00__ai_setting.sql
Normal 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'
|
||||
);
|
||||
14
store/migration/postgres/0.26/00__ai_setting.sql
Normal file
14
store/migration/postgres/0.26/00__ai_setting.sql
Normal 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;
|
||||
13
store/migration/sqlite/0.26/00__ai_setting.sql
Normal file
13
store/migration/sqlite/0.26/00__ai_setting.sql
Normal 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'
|
||||
);
|
||||
Loading…
Add table
Reference in a new issue