Files
TradarrV2/backend/internal/database/migrations/000013_summary_generations.up.sql
Blomios 768c0fd7f5 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>
2026-11-20 21:20:35 +01:00

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);