Migration 001 is applied. docs_document_approved_needs_csv_fields was added NOT VALID — without that the migration aborted, because all 161 legacy rows land at status='published' with no slug, hubspot_category, hubspot_subcategory or summary (verified: 161 rows, 0 summaries).
The constraint is enforced on every insert/update from now on; the 161 are grandfathered.
Known friction: NOT VALID still checks on UPDATE, so editing a legacy row (e.g. caching body_html during triage) fails until it carries the four fields. That will bite the reconcile branch.
When backfilled or retired:
alter table public.docs_document validate constraint docs_document_approved_needs_csv_fields;
Migration 001 is applied.
docs_document_approved_needs_csv_fieldswas added NOT VALID — without that the migration aborted, because all 161 legacy rows land atstatus='published'with no slug, hubspot_category, hubspot_subcategory or summary (verified: 161 rows, 0 summaries).The constraint is enforced on every insert/update from now on; the 161 are grandfathered.
Known friction: NOT VALID still checks on UPDATE, so editing a legacy row (e.g. caching
body_htmlduring triage) fails until it carries the four fields. That will bite the reconcile branch.When backfilled or retired: