mirror of
https://github.com/FlipsideCrypto/movement-models.git
synced 2026-02-06 11:06:43 +00:00
converted incremental conditionals to modified_timestamp; fixed silver__labels datatype for YML contract
This commit is contained in:
parent
550fcb16ac
commit
3aef57fc0f
@ -4,8 +4,8 @@
|
||||
) }}
|
||||
|
||||
SELECT
|
||||
system_created_at,
|
||||
insert_date,
|
||||
system_created_at::TIMESTAMP_NTZ AS system_created_at,
|
||||
insert_date::DATE AS insert_date,
|
||||
blockchain,
|
||||
address,
|
||||
creator,
|
||||
|
||||
@ -56,9 +56,9 @@ WITH evnts AS (
|
||||
AND success
|
||||
|
||||
{% if is_incremental() %}
|
||||
AND inserted_timestamp >= (
|
||||
AND modified_timestamp >= (
|
||||
SELECT
|
||||
MAX(inserted_timestamp)
|
||||
MAX(modified_timestamp)
|
||||
FROM
|
||||
{{ this }}
|
||||
)
|
||||
@ -79,9 +79,9 @@ txs AS (
|
||||
success
|
||||
|
||||
{% if is_incremental() %}
|
||||
AND inserted_timestamp >= (
|
||||
AND modified_timestamp >= (
|
||||
SELECT
|
||||
MAX(inserted_timestamp)
|
||||
MAX(modified_timestamp)
|
||||
FROM
|
||||
{{ this }}
|
||||
)
|
||||
@ -112,9 +112,9 @@ chngs AS (
|
||||
) {# AND amount IS NOT NULL #}
|
||||
|
||||
{% if is_incremental() %}
|
||||
AND inserted_timestamp >= (
|
||||
AND modified_timestamp >= (
|
||||
SELECT
|
||||
MAX(inserted_timestamp)
|
||||
MAX(modified_timestamp)
|
||||
FROM
|
||||
{{ this }}
|
||||
)
|
||||
|
||||
@ -18,9 +18,9 @@ SELECT
|
||||
FROM
|
||||
{{ ref('silver__nft_mints_v2') }}
|
||||
WHERE
|
||||
_inserted_timestamp > (
|
||||
modified_timestamp > (
|
||||
SELECT
|
||||
MAX(_inserted_timestamp) modified_timestamp
|
||||
MAX(modified_timestamp)
|
||||
FROM
|
||||
{{ this }}
|
||||
) {% endset %}
|
||||
@ -39,9 +39,9 @@ WITH base AS (
|
||||
|
||||
{% if is_incremental() %}
|
||||
WHERE
|
||||
_inserted_timestamp >= (
|
||||
modified_timestamp >= (
|
||||
SELECT
|
||||
MAX(_inserted_timestamp)
|
||||
MAX(modified_timestamp)
|
||||
FROM
|
||||
{{ this }}
|
||||
)
|
||||
@ -54,9 +54,9 @@ FROM
|
||||
|
||||
{% if is_incremental() %}
|
||||
WHERE
|
||||
_inserted_timestamp >= (
|
||||
modified_timestamp >= (
|
||||
SELECT
|
||||
MAX(_inserted_timestamp)
|
||||
MAX(modified_timestamp)
|
||||
FROM
|
||||
{{ this }}
|
||||
)
|
||||
@ -73,9 +73,9 @@ xfers AS (
|
||||
success
|
||||
|
||||
{% if is_incremental() %}
|
||||
AND _inserted_timestamp >= (
|
||||
AND modified_timestamp >= (
|
||||
SELECT
|
||||
MAX(_inserted_timestamp)
|
||||
MAX(modified_timestamp)
|
||||
FROM
|
||||
{{ this }}
|
||||
)
|
||||
|
||||
@ -22,7 +22,7 @@ WITH evnts AS (
|
||||
event_data,
|
||||
event_module,
|
||||
event_type,
|
||||
inserted_timestamp
|
||||
modified_timestamp
|
||||
FROM
|
||||
{{ ref('core__fact_events') }}
|
||||
WHERE
|
||||
@ -34,10 +34,10 @@ WITH evnts AS (
|
||||
)
|
||||
|
||||
{% if is_incremental() %}
|
||||
AND inserted_timestamp >= GREATEST(
|
||||
AND modified_timestamp >= GREATEST(
|
||||
(
|
||||
SELECT
|
||||
MAX(inserted_timestamp)
|
||||
MAX(modified_timestamp)
|
||||
FROM
|
||||
{{ this }}
|
||||
),
|
||||
|
||||
@ -17,10 +17,10 @@ SELECT
|
||||
FROM
|
||||
{{ ref('core__fact_events') }}
|
||||
WHERE
|
||||
_inserted_timestamp > GREATEST(
|
||||
modified_timestamp > GREATEST(
|
||||
(
|
||||
SELECT
|
||||
MAX(_inserted_timestamp)
|
||||
MAX(modified_timestamp)
|
||||
FROM
|
||||
{{ this }}
|
||||
),
|
||||
@ -47,7 +47,7 @@ WITH evnts AS (
|
||||
event_data,
|
||||
event_module,
|
||||
event_type,
|
||||
inserted_timestamp
|
||||
modified_timestamp
|
||||
FROM
|
||||
{{ ref('core__fact_events') }}
|
||||
WHERE
|
||||
@ -57,10 +57,10 @@ WITH evnts AS (
|
||||
'0x1::coin::WithdrawEvent'
|
||||
)
|
||||
{% if is_incremental() %}
|
||||
AND inserted_timestamp >= GREATEST(
|
||||
AND modified_timestamp >= GREATEST(
|
||||
(
|
||||
SELECT
|
||||
MAX(inserted_timestamp)
|
||||
MAX(modified_timestamp)
|
||||
FROM
|
||||
{{ this }}
|
||||
),
|
||||
@ -87,10 +87,10 @@ chngs AS (
|
||||
)
|
||||
)
|
||||
{% if is_incremental() %}
|
||||
AND inserted_timestamp >= GREATEST(
|
||||
AND modified_timestamp >= GREATEST(
|
||||
(
|
||||
SELECT
|
||||
MAX(inserted_timestamp)
|
||||
MAX(modified_timestamp)
|
||||
FROM
|
||||
{{ this }}
|
||||
),
|
||||
@ -109,10 +109,10 @@ xfers AS (
|
||||
WHERE
|
||||
success
|
||||
{% if is_incremental() %}
|
||||
AND inserted_timestamp >= GREATEST(
|
||||
AND modified_timestamp >= GREATEST(
|
||||
(
|
||||
SELECT
|
||||
MAX(inserted_timestamp)
|
||||
MAX(modified_timestamp)
|
||||
FROM
|
||||
{{ this }}
|
||||
),
|
||||
@ -130,10 +130,10 @@ xfers AS (
|
||||
WHERE
|
||||
success
|
||||
{% if is_incremental() %}
|
||||
AND inserted_timestamp >= GREATEST(
|
||||
AND modified_timestamp >= GREATEST(
|
||||
(
|
||||
SELECT
|
||||
MAX(inserted_timestamp)
|
||||
MAX(modified_timestamp)
|
||||
FROM
|
||||
{{ this }}
|
||||
),
|
||||
|
||||
@ -29,7 +29,7 @@ WITH events AS (
|
||||
'AcceptTokenBidEvent'
|
||||
) THEN 'bid_won'
|
||||
END AS event_kind,
|
||||
inserted_timestamp
|
||||
modified_timestamp
|
||||
FROM
|
||||
{{ ref('core__fact_events') }}
|
||||
WHERE
|
||||
@ -42,10 +42,10 @@ WITH events AS (
|
||||
AND success
|
||||
|
||||
{% if is_incremental() %}
|
||||
AND inserted_timestamp >= GREATEST(
|
||||
AND modified_timestamp >= GREATEST(
|
||||
(
|
||||
SELECT
|
||||
MAX(inserted_timestamp)
|
||||
MAX(modified_timestamp)
|
||||
FROM
|
||||
{{ this }}
|
||||
),
|
||||
@ -68,10 +68,10 @@ chngs AS (
|
||||
AND inner_change_type = '0x4::collection::Collection'
|
||||
|
||||
{% if is_incremental() %}
|
||||
AND inserted_timestamp >= GREATEST(
|
||||
AND modified_timestamp >= GREATEST(
|
||||
(
|
||||
SELECT
|
||||
MAX(inserted_timestamp)
|
||||
MAX(modified_timestamp)
|
||||
FROM
|
||||
{{ this }}
|
||||
),
|
||||
|
||||
Loading…
Reference in New Issue
Block a user