feat(coach): add encrypted conversation-summary columns (migration 0114)

This commit is contained in:
Marc-André Bombeck committed 2026-06-04 03:38:19 +02:00
1 parent 462c6e8925
commit 7246aa2823
2 files changed
+12

No files matched your search

@@ -0,0 +1,5 @@
-- v1.11.0 — rolling encrypted conversation summary for the Coach.
-- Additive only; safe on a populated table (nullable + defaulted).
ALTER TABLE "coach_conversations" ADD COLUMN IF NOT EXISTS "summary_encrypted" BYTEA;
ALTER TABLE "coach_conversations" ADD COLUMN IF NOT EXISTS "summary_updated_at" TIMESTAMP(3);
ALTER TABLE "coach_conversations" ADD COLUMN IF NOT EXISTS "summary_turn_count" INTEGER NOT NULL DEFAULT 0;
+7
View File
@@ -2629,6 +2629,13 @@ model CoachConversation {
createdAt DateTime @default(now()) @map("created_at")
updatedAt DateTime @updatedAt @map("updated_at")
// v1.11.0 — rolling encrypted summary of the elided older turns, so a long
// conversation keeps memory of what came before without re-sending every
// turn to the provider. AES-256-GCM (same codec as CoachMessage.encrypted).
summaryEncrypted Bytes? @map("summary_encrypted")
summaryUpdatedAt DateTime? @map("summary_updated_at")
summaryTurnCount Int @default(0) @map("summary_turn_count")
user User @relation(fields: [userId], references: [id], onDelete: Cascade)
messages CoachMessage[]