Remove transitional FK NOT DEFERRABLE convergence - #106
Draft
davegaeddert wants to merge 1 commit into
Draft
Conversation
Foreign keys are created NOT DEFERRABLE by construction, so the one-time convergence path that flipped legacy DEFERRABLE FKs with a catalog-only ALTER CONSTRAINT has no remaining job. Drops SetConstraintNotDeferrableCorrection, DriftKind.DEFERRABLE and the ForeignKeyNameDrift member that used it, the deferrable comparison in _compare_foreign_keys, ConstraintState.deferrable, and the condeferrable column from the pg_constraint introspection query. The rename, replace, and validate corrections are unaffected. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01WEvVhrMA6hqzxQGdN5AxWj
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Removes the one-time convergence path that flipped legacy
DEFERRABLEforeign keys — created by older Plain releases — toNOT DEFERRABLEwith a catalog-onlyALTER CONSTRAINT:SetConstraintNotDeferrableCorrection,DriftKind.DEFERRABLEand theForeignKeyNameDriftmember that carried it, thecs.deferrablecomparison in_compare_foreign_keys,ConstraintState.deferrable, and thecondeferrablecolumn in thepg_constraintintrospection query, along with the tests and helper that covered the flip. Foreign keys are stillNOT DEFERRABLEby construction in_foreign_key_not_valid_sql, and the rename, replace, and validate corrections are untouched. Precondition: this may only merge once every deployed app has runpostgres syncon a release containing 8cbfa0c — until then some databases still holdDEFERRABLEFKs that only this code converges, and merging early would leave them silently deferred forever.Generated by Claude Code