mirror of
https://github.com/MBombeck/HealthLog.git
synced 2026-11-09 04:50:59 +00:00
feat(coach): add encrypted conversation-summary columns (migration 0114)
This commit is contained in:
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;
|
||||
@@ -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[]
|
||||
|
||||
|
||||
Reference in new issue
Block a user