Skip to content

Switch dbt_constraints for dbt-core constraints #11

@ataft

Description

@ataft

dbt 1.5+ supports primary_key and foreign_key constraints. However, as of dbt-core v1.5.2, constraints require contracts to be enabled. The catch-22 is that contracts then require ALL model columns to define data_type, but data_type is database-specific, so you lose the incredible database agnostic features of dbt. For this reason, we use the dbt_constraints package to enable cross-database support for primary and foreign keys.

This issue has been raised in the following dbt-core discussion: dbt-labs/dbt-core#6726

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions