arbitrum-models/macros/decoder/run_decoded_logs_history.sql
drethereum 384d1b11e4
AN-5775/sl2-migration-arb (#307)
* initial build pt 1

* decoder changes

* dbt project

* arbtrace_block history

* global node url

* comments

* removed macro

* partition_key

* prod uri
2025-02-19 10:21:38 -07:00

29 lines
912 B
SQL

{% macro run_decoded_logs_history() %}
{% set blockchain = var('GLOBAL_PROD_DB_NAME','').lower() %}
{% set check_for_new_user_abis_query %}
select 1
from {{ ref('silver__user_verified_abis') }}
where _inserted_timestamp::date = sysdate()::date
and dayname(sysdate()) <> 'Sat'
{% endset %}
{% set results = run_query(check_for_new_user_abis_query) %}
{% if execute %}
{% set new_user_abis = results.columns[0].values()[0] %}
{% if new_user_abis %}
{% set invoke_workflow_query %}
SELECT
github_actions.workflow_dispatches(
'FlipsideCrypto',
'{{ blockchain }}' || '-models',
'dbt_run_streamline_decoded_logs_history.yml',
NULL
)
{% endset %}
{% do run_query(invoke_workflow_query) %}
{% endif %}
{% endif %}
{% endmacro %}