diff --git a/.changes/unreleased/Under the Hood-20220404-144708.yaml b/.changes/unreleased/Under the Hood-20220404-144708.yaml new file mode 100644 index 00000000000..5ed2e46caa4 --- /dev/null +++ b/.changes/unreleased/Under the Hood-20220404-144708.yaml @@ -0,0 +1,7 @@ +kind: Under the Hood +body: Remove unneeded create_schema in snapshot materialization +time: 2022-04-04T14:47:08.960642+02:00 +custom: + Author: jtcohen6 + Issue: "4742" + PR: "4993" diff --git a/core/dbt/include/global_project/macros/materializations/snapshots/snapshot.sql b/core/dbt/include/global_project/macros/materializations/snapshots/snapshot.sql index 76a9b5898f7..c1da517c343 100644 --- a/core/dbt/include/global_project/macros/materializations/snapshots/snapshot.sql +++ b/core/dbt/include/global_project/macros/materializations/snapshots/snapshot.sql @@ -6,10 +6,6 @@ {%- set strategy_name = config.get('strategy') -%} {%- set unique_key = config.get('unique_key') %} - {% if not adapter.check_schema_exists(model.database, model.schema) %} - {% do create_schema(model.database, model.schema) %} - {% endif %} - {% set target_relation_exists, target_relation = get_or_create_relation( database=model.database, schema=model.schema,