Skip to content

migrate --live: the catalog front-end reads no UNIQUE constraints or indexes at all (only the pk) #314

Description

@Sorcecoder

Found while fixing M1/M1b (composite/partial unique handling in the schema.sql path). crates/jerrycan/src/platform/migrate/live.rs — the --live catalog front-end — only sets unique on the primary key; it reads no table-level UNIQUE constraints and no unique indexes (single-column, composite, or partial). So a live migration silently drops the entire unique class: the migrated app permits duplicates the source rejects, with no gap item.

This is the same silent-drop class as M1 (#309) and M1b, but in a different front-end, and broader (every unique, not just composite). Pre-existing.

Suggested: read pg_constraint (contype='u') and pg_index (indisunique, with indpred for partial) in live mode and route them through the same composite_uniques / unrepresentable_uniques / unique_reproducible machinery M1/M1b added, so live and schema.sql paths agree. Also noted: UNIQUE ... NULLS NOT DISTINCT is under-enforced on both paths.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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