backport(1.11): drop the model's outbound foreign keys too (#632) - #794
Open
axellpadilla wants to merge 2 commits into
Open
backport(1.11): drop the model's outbound foreign keys too (#632)#794axellpadilla wants to merge 2 commits into
axellpadilla wants to merge 2 commits into
Conversation
drop_fk_constraints() only matched foreign keys whose referenced table was the model, so the keys the table itself declares survived the macro and kept blocking a truncate or rebuild of the table they point at. Join on parent_object_id as well, still scoped to the model's own schema. Consolidate the module's tests into a single project and dbt invocation, adding fk_model to cover both directions. No CHANGELOG change, so this cherry-picks clean onto release/v1.11.
axellpadilla
added a commit
that referenced
this pull request
Aug 1, 2026
Both workflows filtered on `branches: [master, v*]`. GitHub matches the whole ref, so `v*` matches a branch literally named `v1.11` but not `release/v1.11` — the naming this repo actually uses. Pull requests targeting a release branch therefore ran pre-commit only: no unit tests and no integration matrix. That left backports as the least-tested changes in the repo, despite shipping first. #791 and #794 currently have no test coverage at all. Adding `release/**` to the push and pull_request filters of both workflows. Stacked pull requests (base is a feature branch rather than master or a release branch) are still uncovered by design; those are validated once rebased, or by dispatching the workflow against the branch.
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.
Backport of #793 to
release/v1.11.drop_fk_constraints()only matched foreign keys whose referenced table was the model, so the keys the table itself declares survived the macro and kept blocking a truncate or rebuild of the table they point at. The join now also matchesparent_object_id, still scoped to the model's own schema.The fix commit cherry-picks clean from master (
6d7d5aa), with the changelog kept as a separate commit. Stacked on #791 rather thanrelease/v1.11directly, because the(nolock)hints on this same join arrive with #791 — retarget once that merges.test_index_macros.pypasses on this branch (3/3), including the new both-directions assertion.