feat(generation): persist summary outcomes without articles

Record generation outcomes and summaries for history while keeping article content transient.

Refs #7

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
2026-11-20 21:20:35 +01:00
parent 9970b49746
commit 768c0fd7f5
26 changed files with 1657 additions and 438 deletions

View File

@ -0,0 +1,8 @@
CREATE TABLE summary_generations (
id UUID PRIMARY KEY DEFAULT gen_random_uuid(),
user_id UUID NOT NULL REFERENCES users(id) ON DELETE CASCADE,
summary_id UUID REFERENCES summaries(id) ON DELETE SET NULL,
outcome JSONB NOT NULL CHECK (jsonb_typeof(outcome) = 'object'),
created_at TIMESTAMPTZ NOT NULL DEFAULT NOW()
);
CREATE INDEX summary_generations_user_created_idx ON summary_generations (user_id, created_at DESC);