diff --git a/src/storage/postgres/manager.py b/src/storage/postgres/manager.py index d8a20a2a..cd67c8e5 100644 --- a/src/storage/postgres/manager.py +++ b/src/storage/postgres/manager.py @@ -171,6 +171,7 @@ class PostgresManager(metaclass=SingletonMeta): "ALTER TABLE IF EXISTS skills ADD COLUMN IF NOT EXISTS tool_dependencies JSONB DEFAULT '[]'::jsonb", "ALTER TABLE IF EXISTS skills ADD COLUMN IF NOT EXISTS mcp_dependencies JSONB DEFAULT '[]'::jsonb", "ALTER TABLE IF EXISTS skills ADD COLUMN IF NOT EXISTS skill_dependencies JSONB DEFAULT '[]'::jsonb", + "ALTER TABLE IF EXISTS conversations ADD COLUMN IF NOT EXISTS is_pinned BOOLEAN NOT NULL DEFAULT FALSE", "ALTER TABLE IF EXISTS mcp_servers ADD COLUMN IF NOT EXISTS env JSONB", """ CREATE TABLE IF NOT EXISTS agent_runs ( @@ -192,6 +193,7 @@ class PostgresManager(metaclass=SingletonMeta): "CREATE INDEX IF NOT EXISTS idx_agent_runs_user_created ON agent_runs(user_id, created_at DESC)", "CREATE INDEX IF NOT EXISTS idx_agent_runs_thread_created ON agent_runs(thread_id, created_at DESC)", "CREATE INDEX IF NOT EXISTS idx_agent_runs_status_updated ON agent_runs(status, updated_at)", + "CREATE INDEX IF NOT EXISTS ix_conversations_is_pinned ON conversations(is_pinned)", ] async with self.async_engine.begin() as conn: for stmt in stmts: