Files
agent/backend/migrations/0001_search_indexes.sql

24 lines
1.1 KiB
MySQL
Raw Normal View History

CREATE INDEX IF NOT EXISTS idx_senlin_agent_projects_search
ON senlin_agent_projects
2026-07-18 17:42:50 +08:00
USING gin (to_tsvector('simple', coalesce(name, '') || ' ' || coalesce(description, '')));
CREATE INDEX IF NOT EXISTS idx_senlin_agent_notes_search
ON senlin_agent_notes
2026-07-18 16:03:06 +08:00
USING gin (to_tsvector('simple', coalesce(title, '') || ' ' || coalesce(markdown, '')));
CREATE INDEX IF NOT EXISTS idx_senlin_agent_sources_search
ON senlin_agent_sources
2026-07-18 16:03:06 +08:00
USING gin (to_tsvector('simple', coalesce(title, '') || ' ' || coalesce(url, '') || ' ' || coalesce(content_text, '')));
CREATE INDEX IF NOT EXISTS idx_senlin_agent_inbox_items_search
ON senlin_agent_inbox_items
2026-07-18 16:03:06 +08:00
USING gin (to_tsvector('simple', coalesce(title, '') || ' ' || coalesce(body, '')));
CREATE INDEX IF NOT EXISTS idx_senlin_agent_tasks_search
ON senlin_agent_tasks
2026-07-18 16:03:06 +08:00
USING gin (to_tsvector('simple', coalesce(title, '') || ' ' || coalesce(description, '')));
CREATE INDEX IF NOT EXISTS idx_senlin_agent_ai_sessions_search
ON senlin_agent_ai_sessions
2026-07-18 16:03:06 +08:00
USING gin (to_tsvector('simple', coalesce(title, '') || ' ' || coalesce(context, '')));