mirror of
https://github.com/FlipsideCrypto/aptos-models.git
synced 2026-02-06 11:46:43 +00:00
add macro
This commit is contained in:
parent
1e5ce625f9
commit
582e1c77b5
11
macros/get_missing_verified_tokens.sql
Normal file
11
macros/get_missing_verified_tokens.sql
Normal file
@ -0,0 +1,11 @@
|
||||
{% macro get_missing_verified_tokens(column_name='token_address') %}
|
||||
SELECT DISTINCT LOWER(p.token_address) AS token_address
|
||||
FROM {{ ref('price__ez_prices_hourly') }} p
|
||||
WHERE p.is_verified = TRUE
|
||||
AND p.token_address IS NOT NULL
|
||||
AND NOT EXISTS (
|
||||
SELECT 1
|
||||
FROM {{ this }} t
|
||||
WHERE LOWER(t.{{ column_name }}) = LOWER(p.token_address)
|
||||
)
|
||||
{% endmacro %}
|
||||
@ -1,7 +1,7 @@
|
||||
{% macro unverify_tokens() %}
|
||||
{% macro unverify_tokens(column_name='token_address') %}
|
||||
{% if var('HEAL_MODEL', false) and is_incremental() %}
|
||||
DELETE FROM {{ this }}
|
||||
WHERE LOWER(token_address) NOT IN (
|
||||
WHERE LOWER({{ column_name }}) NOT IN (
|
||||
SELECT DISTINCT LOWER(token_address)
|
||||
FROM {{ ref('price__ez_prices_hourly') }}
|
||||
WHERE
|
||||
|
||||
Loading…
Reference in New Issue
Block a user