File tree Expand file tree Collapse file tree 1 file changed +11
-1
lines changed
dbt/include/sqlite/macros/materializations/incremental Expand file tree Collapse file tree 1 file changed +11
-1
lines changed Original file line number Diff line number Diff line change 2121 ;
2222{%- endmacro %}
2323
24- {# override this just so we can call sqlite_incremental_upsert #}
24+ {#
25+ the incremental materialization was overhauled in dbt 1 .3 .0 to make it easier to override
26+ adapter- specific pieces, but it' s hard to use it as intended in our case, because it renames
27+ models, which is difficult to handle so we just avoid it
28+
29+ also, we call sqlite_incremental_upsert b/c the syntax for insert differs
30+ #}
2531{% materialization incremental, adapter=' sqlite' -%}
2632
2733 {% set unique_key = config.get(' unique_key' ) %}
6369
6470 {% do persist_docs(target_relation, model) %}
6571
72+ {% if existing_relation is none or existing_relation .is_view or should_full_refresh() %}
73+ {% do create_indexes(target_relation) %}
74+ {% endif %}
75+
6676 {{ run_hooks(post_hooks, inside_transaction= True) }}
6777
6878 -- `COMMIT` happens here
You can’t perform that action at this time.
0 commit comments