Skip to content

Commit

Permalink
Update post-hook for "latest" model version
Browse files Browse the repository at this point in the history
This is still just a placeholder "YMMV" solution until we decide on a real implementation:
- dbt-labs/dbt-core#7442
  • Loading branch information
jtcohen6 authored Jun 30, 2023
1 parent 0f22ae0 commit 4e19710
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion website/docs/docs/collaborate/govern/model-versions.md
Original file line number Diff line number Diff line change
Expand Up @@ -326,7 +326,13 @@ We intend to build this into `dbt-core` as out-of-the-box functionality. (Upvote
-- otherwise, it's a no-op
{% if model.get('version') and model.get('version') == model.get('latest_version') %}
{% set new_relation = this.incorporate(path={"identifier": model['name']}) %}
{% set new_relation = this.incorporate(path={"identifier": model['name']}) %}
{% set existing_relation = load_relation(new_relation) %}
{% if existing_relation and not existing_relation.is_view %}
{{ drop_relation_if_exists(existing_relation) }}
{% endif %}
{% set create_view_sql -%}
-- this syntax may vary by data platform
Expand Down

0 comments on commit 4e19710

Please sign in to comment.