feat(db): migration 007 — conversations.space_id + seed companion agent

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
root
2026-06-01 18:06:34 +10:00
parent d0d61575e3
commit cf0510872e
2 changed files with 37 additions and 0 deletions

View File

@@ -0,0 +1,14 @@
-- lib/db/migrations/007_companion.sql
-- Plan 5: per-Space ambient companion conversation + default companion agent.
ALTER TABLE conversations
ADD COLUMN space_id uuid REFERENCES spaces(id) ON DELETE CASCADE;
CREATE INDEX idx_conversations_space ON conversations(space_id, started_at DESC);
INSERT INTO agents (slug, name, kind, model, capabilities)
VALUES (
'companion', 'Companion', 'claude', NULL,
'{"read":true,"suggest":true,"write":false}'::jsonb
)
ON CONFLICT (slug) DO NOTHING;