Skip to content

fix(db): paren-insensitive constraint-drift comparison - #113

Merged
iamjr15 merged 1 commit into
mainfrom
fix/constraint-def-normalization
Aug 2, 2026
Merged

fix(db): paren-insensitive constraint-drift comparison#113
iamjr15 merged 1 commit into
mainfrom
fix/constraint-def-normalization

Conversation

@iamjr15

@iamjr15 iamjr15 commented Aug 2, 2026

Copy link
Copy Markdown
Contributor

Found by the fresh-project e2e's final target assertion: pg_get_constraintdef prints AND-chains left-associated on PG 17.4 (where the pinned definitions were dumped) but flattened on 17.6 (fresh Supabase projects today) — semantically identical, textually different, so the drift check false-fired. Also future-proofs production's own eventual minor upgrade.

Both sides of the comparison are now parenthesis-stripped; operator/literal/regex weakening still surfaces, which is what the check exists to catch.

Verification notes

  • pnpm lint / pnpm typecheck / pnpm turbo build --force / pnpm deadcode / pnpm architecture:check
  • Post-merge: wizard resume must clear the target assertion on the fresh 17.6 project (migrations 0000-0003 already ledgered there) and proceed to provisioning + probes.

pg_get_constraintdef's AND-chain grouping changed between Postgres minors:
17.4 prints left-associated parentheses, 17.6 flattens the chain. The pinned
definitions came from the 17.4 production dump, so the drift check false-fired
on a fresh 17.6 project (and would fire on production after its next minor
upgrade). Comparing both sides with parentheses stripped keeps the check's
purpose — operator, literal, and regex changes still surface.
@iamjr15
iamjr15 merged commit 88a765a into main Aug 2, 2026
4 checks passed
@iamjr15
iamjr15 deleted the fix/constraint-def-normalization branch August 2, 2026 08:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant