Skip to content

Commit

Permalink
Fix materialized view cleanup bug
Browse files Browse the repository at this point in the history
  • Loading branch information
Willy Hardy authored and damian3031 committed Oct 24, 2023
1 parent b856822 commit 5447aed
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
7 changes: 7 additions & 0 deletions .changes/unreleased/Fixes-20231020-112317.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
kind: Fixes
body: Fix materialized view cleanup bug.
time: 2023-10-20T11:23:17.134994-04:00
custom:
Author: wjhrdy
Issue: "366"
PR: "367"
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,10 @@

{% if existing_relation is not none %}
{{ log("Found a " ~ existing_relation.type ~ " with same name. Will drop it", info=true) }}
alter {{ existing_relation.type|replace("_", " ") }} {{ existing_relation }} rename to {{ backup_relation.include(database=False, schema=False) }};
alter {{ existing_relation.type|replace("_", " ") }} {{ existing_relation }} rename to {{ backup_relation }};
{% endif %}

alter materialized view {{ intermediate_relation }} rename to {{ relation.include(database=False, schema=False) }};
alter materialized view {{ intermediate_relation }} rename to {{ relation }};

{% endmacro %}

Expand Down

0 comments on commit 5447aed

Please sign in to comment.