dbt model contracts enforce YAML column names, types, and constraints
contract | dbt Developer Hub
Reference docs for dbt’s contract config: enforced schema match for supported SQL materializations, with type aliasing notes.
Based on
The extract states that an enforced contract checks the model output against YAML attributes—every column’s name and data_type, plus additional constraints where the materialization and platform allow. It argues subtle type changes can fail downstream queries in surprising ways, so contracts give control over schema enforcement on one model or many.
For data engineering teams, the prerequisites matter as much as the promise: contracts apply via dbt_project.yml or properties YAML on SQL table, view (names and types only), and incremental models under specific on_schema_change settings. Python models, ephemeral and materialized views, recursive CTEs on BigQuery, and non-model resources are called out as unsupported.
This is schema-as-agreement: the YAML definition becomes the shared shape consumers can rely on across systems. Built-in type aliasing (for example string to text on Postgres/Redshift) keeps that shared shape portable across platforms without inventing a separate type system per warehouse.
Put this to work on CoreModels
Related connectors and recipes
See all connectors →Take the next step
Try CoreModels, talk with our team, or explore more resources.