diff --git a/elementary/monitor/dbt_project/dbt_project.yml b/elementary/monitor/dbt_project/dbt_project.yml index 71a16879e..ce4e3dbe0 100644 --- a/elementary/monitor/dbt_project/dbt_project.yml +++ b/elementary/monitor/dbt_project/dbt_project.yml @@ -35,10 +35,3 @@ quoting: database: "{{ env_var('DATABASE_QUOTING', 'None') | as_native }}" schema: "{{ env_var('SCHEMA_QUOTING', 'None') | as_native }}" identifier: "{{ env_var('IDENTIFIER_QUOTING', 'None') | as_native }}" - -# In this example config, we tell dbt to build all models in the example/ directory -# as tables. These settings can be overridden in the individual model files -# using the `{{ config(...) }}` macro. -models: - # Required in order to apply table schema changes in the table materialization. - +on_schema_change: "append_new_columns" diff --git a/elementary/monitor/dbt_project/macros/materializations/incremental.sql b/elementary/monitor/dbt_project/macros/materializations/incremental.sql deleted file mode 100644 index b83e24345..000000000 --- a/elementary/monitor/dbt_project/macros/materializations/incremental.sql +++ /dev/null @@ -1,19 +0,0 @@ -{# We override the materialization in order to achieve schema migration mode without actually transforming the data. #} -{% materialization incremental, default -%} - {% if not var("sync", false) %} - {{ return(dbt.materialization_incremental_default()) }} - {% endif %} - - {% set init_schema_sql %} - with result as ( - {{ sql }} - ) - select * from result where 1 = 0 - {% endset %} - {% do context.update({ - "sql": init_schema_sql, - "pre_hooks": [], - "post_hooks": [], - }) %} - {{ return(dbt.materialization_incremental_default()) }} -{% endmaterialization %} diff --git a/elementary/monitor/dbt_project/macros/materializations/table.sql b/elementary/monitor/dbt_project/macros/materializations/table.sql deleted file mode 100644 index fafca1bd2..000000000 --- a/elementary/monitor/dbt_project/macros/materializations/table.sql +++ /dev/null @@ -1,20 +0,0 @@ -{# We override the materialization in order to achieve schema migration mode without actually transforming the data. #} -{% materialization table, default -%} - {% if not var("sync", false) %} - {{ return(dbt.materialization_table_default()) }} - {% endif %} - - {% set init_schema_sql %} - with result as ( - {{ sql }} - ) - select * from result where 1 = 0 - {% endset %} - {% do context.update({ - "sql": init_schema_sql, - "pre_hooks": [], - "post_hooks": [], - }) %} - {# We call the incremental materialization in order to hand-off the implementation of schema changes to dbt. #} - {{ return(dbt.materialization_incremental_default()) }} -{% endmaterialization %}