Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Constraint Name should be optional and generate a unique name #186

Open
bebemn opened this issue Jun 4, 2024 · 1 comment
Open

Constraint Name should be optional and generate a unique name #186

bebemn opened this issue Jun 4, 2024 · 1 comment

Comments

@bebemn
Copy link

bebemn commented Jun 4, 2024

The documentation for constraints in dbt specifies that the name property is optional. If the name is left out of the definition dbt-fabric throws the following exception.

Database Error in model model1 (models\gold\datamart1\dimensions\table1.sql)
Constraint name cannot be empty. Provide constraint name  - column column1_hk and run the project again.
compiled Code at target\run\project1\models\gold\datamart1\dimensions\table1.sql

This was more of a problem when Fabric Data Warehouse prohibited using the same constraint name on multiple objects. This limitation appears to have been removed, at least in regard to tables in different schemas. However, it does not follow the standard and users changing platforms may have issue with this.

@prdpsvs
Copy link
Collaborator

prdpsvs commented Jun 21, 2024

@bebemn,
Yes, the limitation still exists within a schema. What would be a good default naming convention for a constraint? {object}{pk/fk/uk}{column name}?

And what standard are you referring to?

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

No branches or pull requests

2 participants