[CT-3544] [Bug] Model level constraints aren't being applied to versioned models #9364
Closed
2 tasks done
Labels
backport 1.7.latest
bug
Something isn't working
High Severity
bug with significant impact that should be resolved in a reasonable timeframe
Is this a new bug in dbt-core?
Current Behavior
If you're using model versions (https://docs.getdbt.com/docs/collaborate/govern/model-versions), model level constraints (https://docs.getdbt.com/reference/resource-properties/constraints#defining-constraints) don't seem to be applied to the model.
Expected Behavior
Model level constraints should be applied as expected.
Steps To Reproduce
First let's look at a well behaved model level constraints example (without model versioning).
Do a run:
We see the constraint
primary key (id, user_name)
is applied.Now let's rename the file
foo.sql
>foo_v1.sql
and edit theschema.yml
files contents:Do a run:
A versioned model of
foo
is created (foo_v1
) and column level contraints are applied but the model level constraint is not applied.Relevant log output
No response
Environment
Which database adapter are you using with dbt?
postgres
Additional Context
No response
The text was updated successfully, but these errors were encountered: