Record generation outcomes and summaries for history while keeping article content transient. Refs #7 Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
9 lines
440 B
SQL
9 lines
440 B
SQL
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);
|