From 1e5ce625f947fac137e5c0e42c17ab02acfe5de0 Mon Sep 17 00:00:00 2001 From: stanz Date: Mon, 8 Dec 2025 21:29:51 +0700 Subject: [PATCH] add macro --- macros/unverify_tokens.sql | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100644 macros/unverify_tokens.sql 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 %}