fix: add folder_id and sort_order to AIChatSession model, fix UUID conversion in routes, add migration 0003

This commit is contained in:
Agent Zero
2026-07-17 21:20:49 +02:00
parent 165350eda0
commit 3fc4dcdb96
5 changed files with 38 additions and 3 deletions
@@ -0,0 +1,8 @@
-- Migration 0003: Add sort_order columns for drag&drop reordering
ALTER TABLE ai_chat_sessions ADD COLUMN IF NOT EXISTS sort_order INTEGER NOT NULL DEFAULT 0;
ALTER TABLE ai_chat_folders ADD COLUMN IF NOT EXISTS sort_order INTEGER NOT NULL DEFAULT 0;
CREATE INDEX IF NOT EXISTS ix_ai_sessions_folder ON ai_chat_sessions(folder_id);
CREATE INDEX IF NOT EXISTS ix_ai_sessions_sort ON ai_chat_sessions(sort_order);
CREATE INDEX IF NOT EXISTS ix_ai_folders_sort ON ai_chat_folders(sort_order);