feat: add migration 006_memory.sql for cross-chat memory tables

Add two new tables for cross-chat memory feature:
- memory_facts: stores explicit user-provided facts (user_id, content, created_at)
- conversation_summaries: stores conversation summaries with vector embeddings for similarity search

This migration prepares the database schema for Task 2-7 of the cross-chat memory feature plan.
No indexes yet (sequential scan sufficient for expected data volume).

Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019iZMEPk2Kt1UC96Lo9bC5w
This commit is contained in:
Jonny 2026-09-13 11:56:32 +02:00
parent 32026d4264
commit 8856ef16a1
1 changed files with 13 additions and 0 deletions

13
migrations/006_memory.sql Normal file
View File

@ -0,0 +1,13 @@
CREATE TABLE memory_facts (
id SERIAL PRIMARY KEY,
user_id INTEGER NOT NULL REFERENCES users(id),
content TEXT NOT NULL,
created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP
);
CREATE TABLE conversation_summaries (
conversation_id INTEGER PRIMARY KEY REFERENCES conversations(id),
summary TEXT NOT NULL,
embedding vector(768) NOT NULL,
updated_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP
);