diff --git a/macros/unverify_tokens.sql b/macros/unverify_tokens.sql new file mode 100644 index 0000000..48ba5d3 --- /dev/null +++ b/macros/unverify_tokens.sql @@ -0,0 +1,12 @@ +{% macro unverify_tokens() %} + {% if var('HEAL_MODEL', false) and is_incremental() %} + DELETE FROM {{ this }} + WHERE LOWER(token_address) NOT IN ( + SELECT DISTINCT LOWER(token_address) + FROM {{ ref('price__ez_prices_hourly') }} + WHERE + is_verified = TRUE + AND token_address IS NOT NULL + ); + {% endif %} +{% endmacro %}