dbt Model Versioning

dbt model versioning to avoid breaking downstream consumers

Models A -> B -> Consumers.

There is a major change in B to be observed on production for some time before publishing to consumers.

Versioning model B is the perfect approach for this use case to test-drive new logic while limiting code changes to a single model.

Existing consumers:

SELECT * FROM b;

New logic data:

SELECT * FROM b_v2;

models:
  - name: b
    latest_version: 1
    versions:
      - v: 1
        defined_in: b
        config:
          alias: b
      - v: 2
        defined_in: b_v2

Last modified on 2025-04-25