Skip to content

fix: constraint name collision on rebuild with safer relation operations#1600

Closed
saishreeeee wants to merge 2 commits into
databricks:mainfrom
saishreeeee:PECOBLR-3498
Closed

fix: constraint name collision on rebuild with safer relation operations#1600
saishreeeee wants to merge 2 commits into
databricks:mainfrom
saishreeeee:PECOBLR-3498

Conversation

@saishreeeee

Copy link
Copy Markdown
Contributor

Resolves #1091

Description

Defer primary/foreign keys to an ALTER on the final relation under use_safer_relation_operations, so an unnamed key's auto-generated name derives from the target table instead of the staging table and no longer collides on rebuild.

Checklist

  • I have run this code in development and it appears to resolve the stated issue
  • This PR includes tests, or tests are not required/relevant for this PR
  • I have updated the CHANGELOG.md and added information about my change to the "dbt-databricks next" section.
  • [Optional] I have run the dbt-databricks-pr-ready project skill for this PR and addressed its merge-readiness feedback

@saishreeeee saishreeeee changed the title fix: apply PK/FK on final relation under safer relation operations fix: constraint name collision on rebuild with safer relation operations Jul 22, 2026
@saishreeeee
saishreeeee marked this pull request as ready for review July 22, 2026 08:57
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.

Constraint already exists error for v2 materialization and safer flag

1 participant