mirror of
https://github.com/FlipsideCrypto/crosschain-models.git
synced 2026-02-06 16:16:47 +00:00
clean lower
This commit is contained in:
parent
6a7d62a67e
commit
f4f8fa5ec8
@ -307,7 +307,7 @@ wormhole_secured AS (
|
||||
{% if is_incremental() %}
|
||||
AND inserted_timestamp :: DATE >= (
|
||||
SELECT
|
||||
MAX(modified_timestamp) :: DATE - 30
|
||||
MAX(modified_timestamp) :: DATE - 7
|
||||
FROM
|
||||
{{ this }}
|
||||
)
|
||||
@ -319,7 +319,7 @@ combo AS (
|
||||
address_lower
|
||||
FROM
|
||||
token_base
|
||||
UNION ALL
|
||||
UNION
|
||||
SELECT
|
||||
blockchain,
|
||||
token_address_lower
|
||||
|
||||
@ -2,6 +2,7 @@
|
||||
materialized = 'incremental',
|
||||
unique_key = ['blockchain', 'token_address'],
|
||||
merge_exclude_columns = ['inserted_timestamp'],
|
||||
full_refresh = false,
|
||||
tags = ['daily']
|
||||
) }}
|
||||
|
||||
@ -38,6 +39,7 @@ SELECT
|
||||
'polygon'
|
||||
) AS blockchain,
|
||||
token_address,
|
||||
LOWER(token_address) AS token_address_lower,
|
||||
symbol,
|
||||
cg AS coingecko_id,
|
||||
{{ dbt_utils.generate_surrogate_key(['blockchain','token_address']) }} AS wormhole_secured_tokens_id,
|
||||
@ -47,7 +49,12 @@ SELECT
|
||||
FROM
|
||||
flat_worms qualify ROW_NUMBER() over (
|
||||
PARTITION BY blockchain,
|
||||
token_address
|
||||
token_address_lower
|
||||
ORDER BY
|
||||
--keep the case sensitive token address first
|
||||
CASE
|
||||
WHEN token_address_lower = token_address THEN 1
|
||||
ELSE 0
|
||||
END,
|
||||
_inserted_timestamp DESC
|
||||
) = 1
|
||||
|
||||
Loading…
Reference in New Issue
Block a user