mirror of
https://github.com/FlipsideCrypto/optimism-models.git
synced 2026-02-06 15:21:51 +00:00
AN-2390/update-vars-udf-sp-opt (#46)
* added project level variable and associated IF statements to on-run-start macros to default UDF/SP updates to False * readjusted spacing in macros
This commit is contained in:
parent
3260e3556d
commit
86699e12f7
@ -40,3 +40,4 @@ on-run-start:
|
||||
|
||||
vars:
|
||||
"dbt_date:time_zone": GMT
|
||||
UPDATE_UDFS_AND_SPS: False
|
||||
|
||||
@ -1,6 +1,8 @@
|
||||
{% macro create_sps() %}
|
||||
{% if target.database == 'OPTIMISM' %}
|
||||
CREATE schema IF NOT EXISTS _internal;
|
||||
{{ sp_create_prod_clone('_internal') }};
|
||||
{% if var("UPDATE_UDFS_AND_SPS") %}
|
||||
{% if target.database == 'OPTIMISM' %}
|
||||
CREATE schema IF NOT EXISTS _internal;
|
||||
{{ sp_create_prod_clone('_internal') }};
|
||||
{% endif %}
|
||||
{% endif %}
|
||||
{% endmacro %}
|
||||
|
||||
@ -1,11 +1,13 @@
|
||||
{% macro create_udfs() %}
|
||||
{% set sql %}
|
||||
CREATE schema if NOT EXISTS silver;
|
||||
{{ create_js_hex_to_int() }};
|
||||
{{ create_udf_hex_to_int(
|
||||
schema = "public"
|
||||
) }}
|
||||
{% if var("UPDATE_UDFS_AND_SPS") %}
|
||||
{% set sql %}
|
||||
CREATE schema if NOT EXISTS silver;
|
||||
{{ create_js_hex_to_int() }};
|
||||
{{ create_udf_hex_to_int(
|
||||
schema = "public"
|
||||
) }}
|
||||
|
||||
{% endset %}
|
||||
{% do run_query(sql) %}
|
||||
{% endset %}
|
||||
{% do run_query(sql) %}
|
||||
{% endif %}
|
||||
{% endmacro %}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user