refactor backend packages and global db service

This commit is contained in:
2026-07-18 21:58:15 +08:00
parent 62bd3d0455
commit 7800b07d42
51 changed files with 719 additions and 647 deletions

View File

@@ -1,23 +1,23 @@
CREATE INDEX IF NOT EXISTS idx_projects_search
ON projects
CREATE INDEX IF NOT EXISTS idx_senlin_agent_projects_search
ON senlin_agent_projects
USING gin (to_tsvector('simple', coalesce(name, '') || ' ' || coalesce(description, '')));
CREATE INDEX IF NOT EXISTS idx_notes_search
ON notes
CREATE INDEX IF NOT EXISTS idx_senlin_agent_notes_search
ON senlin_agent_notes
USING gin (to_tsvector('simple', coalesce(title, '') || ' ' || coalesce(markdown, '')));
CREATE INDEX IF NOT EXISTS idx_sources_search
ON sources
CREATE INDEX IF NOT EXISTS idx_senlin_agent_sources_search
ON senlin_agent_sources
USING gin (to_tsvector('simple', coalesce(title, '') || ' ' || coalesce(url, '') || ' ' || coalesce(content_text, '')));
CREATE INDEX IF NOT EXISTS idx_inbox_items_search
ON inbox_items
CREATE INDEX IF NOT EXISTS idx_senlin_agent_inbox_items_search
ON senlin_agent_inbox_items
USING gin (to_tsvector('simple', coalesce(title, '') || ' ' || coalesce(body, '')));
CREATE INDEX IF NOT EXISTS idx_tasks_search
ON tasks
CREATE INDEX IF NOT EXISTS idx_senlin_agent_tasks_search
ON senlin_agent_tasks
USING gin (to_tsvector('simple', coalesce(title, '') || ' ' || coalesce(description, '')));
CREATE INDEX IF NOT EXISTS idx_ai_sessions_search
ON ai_sessions
CREATE INDEX IF NOT EXISTS idx_senlin_agent_ai_sessions_search
ON senlin_agent_ai_sessions
USING gin (to_tsvector('simple', coalesce(title, '') || ' ' || coalesce(context, '')));