skald/migrations/0006_generation_runs_narrate_prep.sql
Kayos 2ed3d3373a migration 0006: extend generation_runs.kind to allow narrate_prep
Migration 0005 added the chapters.body_md_tts column but missed
this check constraint update — caught at runtime when
prepare-narration tried to insert kind='narrate_prep'.

Postgres doesn't ALTER CHECK in place; we drop + re-add.
2026-05-13 20:28:59 -07:00

9 lines
473 B
SQL

-- Extend generation_runs.kind to allow the new narrate_prep pass.
-- (Migration 0005 added body_md_tts but missed the check constraint.)
-- Postgres doesn't support altering a check constraint in place,
-- so we drop + re-add.
ALTER TABLE generation_runs
DROP CONSTRAINT generation_runs_kind_check;
ALTER TABLE generation_runs
ADD CONSTRAINT generation_runs_kind_check
CHECK (kind = ANY (ARRAY['gen', 'cleanup', 'audit', 'summary', 'embed', 'narrate_prep']));