Skip to content

Fix foreign key idempotency failure when pgquery fallback occurs (#1147)#1148

Merged
gfx merged 1 commit intomasterfrom
gfx/issue_1147
Mar 4, 2026
Merged

Fix foreign key idempotency failure when pgquery fallback occurs (#1147)#1148
gfx merged 1 commit intomasterfrom
gfx/issue_1147

Conversation

@gfx
Copy link
Contributor

@gfx gfx commented Mar 4, 2026

Fix foreign key idempotency failure when pgquery fallback occurs (#1147)

The pgquery parser always created ConstraintOptions{false, false} for
foreign keys even without a DEFERRABLE clause, while the generic parser
correctly set it to nil. This mismatch caused areSameForeignKeys to
detect a false difference, leading to unnecessary FK recreation when the
desired schema was parsed by pgquery and the current schema by the
generic parser.

close #1147

@gfx gfx enabled auto-merge March 4, 2026 01:53
@gfx gfx disabled auto-merge March 4, 2026 01:53
@codecov
Copy link

codecov bot commented Mar 4, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.

Files with missing lines Coverage Δ
schema/generator.go 81.10% <100.00%> (+0.14%) ⬆️
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@gfx gfx force-pushed the gfx/issue_1147 branch from e034f2b to 0d54da0 Compare March 4, 2026 05:04
@gfx gfx force-pushed the gfx/issue_1147 branch from 0d54da0 to 8a80226 Compare March 4, 2026 07:30
@gfx gfx enabled auto-merge March 4, 2026 07:31
@gfx gfx added this pull request to the merge queue Mar 4, 2026
Merged via the queue into master with commit b6ac0fe Mar 4, 2026
26 checks passed
@gfx gfx deleted the gfx/issue_1147 branch March 4, 2026 07:44
@sqldef-bot sqldef-bot bot mentioned this pull request Mar 4, 2026
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