Skip to content

Backfill the 161 legacy rows, then VALIDATE the CSV constraint #6

Description

@niel-cody

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;

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions