Skip to content

Versioning a model and retiring the version it replaces

dbt supports model versioning to manage breaking changes to public models without disrupting downstream consumers. By defining multiple versions of a model in YAML and marking older ones as deprecated, teams can migrate consumers on their own timeline while signaling when old versions will be removed.

1 · Learn the must-know

  • Model versions are configured under the 'versions' key in the model's YAML properties, each with a unique 'v' identifier and optional 'defined_in' to point to a different file name.
  • The 'latest_version' property controls which version is resolved when downstream code refs the model without specifying a version, allowing you to promote a new version without breaking unversioned refs.
  • Consumers pin to a specific version using the two-argument ref syntax, e.g. ref('model_name', v=1), ensuring their pipelines are unaffected by changes to the latest version.
  • Deprecating a version is done by setting a 'deprecation_date' on that version in the YAML; dbt will emit warnings (and can be configured to error) when that date has passed and the version is still referenced.
  • Only models configured with access: public (or otherwise exposed via groups/contracts) are typical candidates for versioning, since versioning is meant to manage a stable, shared interface across teams.
  • Versioned models are commonly paired with model contracts to enforce a stable schema per version, so breaking schema changes trigger a new version rather than silently altering an existing one.

2 · Check your understanding

Check this objectiveFree · always available

You add deprecation_date: 2026-09-01 to the v: 1 entry of stg_orders in its YAML versions config. What is the actual effect of this setting once that date passes?

Your objective map0 tried · 0 answered correctly · 31 untouched

What you have tried across dbt Analytics Engineering's objectives, not a readiness score.

Developing and optimizing dbt models45.16% of the exam*0 of 14 tried
Managing dbt models governance9.68% of the exam*0 of 3 tried
Debugging data modeling errors16.13% of the exam*0 of 5 tried
Troubleshooting and optimizing dbt pipelines6.45% of the exam*0 of 2 tried
Implementing dbt tests9.68% of the exam*0 of 3 tried
Implementing and maintaining external dependencies6.45% of the exam*0 of 2 tried
Leveraging the dbt state6.45% of the exam*0 of 2 tried

* Our estimate. dbt Labs publishes no section weights.

3 · Keep going