delete past 6months of vote data (#871)

This commit is contained in:
tarikceric 2025-09-16 09:32:43 -07:00 committed by GitHub
parent 174dd0a91f
commit e7f690b003
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 2 additions and 0 deletions

View File

@ -43,6 +43,7 @@ jobs:
- name: Run DBT Jobs
run: |
dbt test -s "solana_models,tag:test_weekly"
dbt run -s models/silver/core/silver__votes.sql --vars '{"run_votes_cleanup": true}'
notify-failure:
needs: [run_dbt_jobs]

View File

@ -5,6 +5,7 @@
unique_key = "tx_id",
incremental_predicates = ["dynamic_range_predicate", "block_timestamp::date"],
cluster_by = ['block_timestamp::DATE','block_id','_inserted_timestamp::DATE'],
pre_hook = "{% if var('run_votes_cleanup', false) %}DELETE FROM {{ this }} WHERE _inserted_timestamp < CURRENT_DATE - INTERVAL '6 months'{% endif %}",
post_hook = enable_search_optimization('{{this.schema}}','{{this.identifier}}','ON EQUALITY(tx_id)'),
full_refresh = false,
tags = ['scheduled_core']