mirror of
https://github.com/FlipsideCrypto/optimism-models.git
synced 2026-02-06 14:06:44 +00:00
change tracking macro
This commit is contained in:
parent
1a77ece09b
commit
10b69a211a
@ -74,14 +74,7 @@ models:
|
||||
+enabled: true # enable subpackages, as needed
|
||||
gold:
|
||||
+enabled: true
|
||||
+post-hook: >
|
||||
{% if 'exclude_change_tracking' not in config.get('tags') %}
|
||||
{% if config.get('materialized') == 'view' %}
|
||||
ALTER VIEW {{ this }} SET CHANGE_TRACKING = TRUE;
|
||||
{% else %}
|
||||
ALTER TABLE {{ this }} SET CHANGE_TRACKING = TRUE;
|
||||
{% endif %}
|
||||
{% endif %}
|
||||
+post-hook: "{{ enable_change_tracking() }}"
|
||||
bronze:
|
||||
+enabled: false
|
||||
github_actions:
|
||||
@ -133,6 +126,7 @@ vars:
|
||||
HEAL_MODEL: False
|
||||
HEAL_MODELS: []
|
||||
STREAMLINE_USE_DEV_FOR_EXTERNAL_TABLES: False
|
||||
ENABLE_CHANGE_TRACKING: False
|
||||
|
||||
#### STREAMLINE 2.0 BEGIN ####
|
||||
|
||||
|
||||
9
macros/change_tracking.sql
Normal file
9
macros/change_tracking.sql
Normal file
@ -0,0 +1,9 @@
|
||||
{% macro enable_change_tracking() %}
|
||||
{% if 'exclude_change_tracking' not in config.get('tags') and var('ENABLE_CHANGE_TRACKING', false) %}
|
||||
{% if config.get('materialized') == 'view' %}
|
||||
ALTER VIEW {{ this }} SET CHANGE_TRACKING = TRUE;
|
||||
{% else %}
|
||||
ALTER TABLE {{ this }} SET CHANGE_TRACKING = TRUE;
|
||||
{% endif %}
|
||||
{% endif %}
|
||||
{% endmacro %}
|
||||
Loading…
Reference in New Issue
Block a user