mirror of
https://github.com/FlipsideCrypto/flow-models.git
synced 2026-02-06 11:06:45 +00:00
get topshot series id from set creation
This commit is contained in:
parent
2897909595
commit
e7303b0ff4
@ -50,7 +50,8 @@ FINAL AS (
|
||||
) AS play_id,
|
||||
COALESCE(
|
||||
m.series_id,
|
||||
e.series_id
|
||||
e.series_id,
|
||||
sn.series_id
|
||||
) AS series_id,
|
||||
s.series_name,
|
||||
COALESCE(
|
||||
@ -77,15 +78,23 @@ FINAL AS (
|
||||
LEFT JOIN metadata pl
|
||||
ON m.event_contract = pl.event_contract
|
||||
AND COALESCE(
|
||||
e.play_id,
|
||||
m.play_id
|
||||
m.play_id,
|
||||
e.play_id
|
||||
) = pl.play_id
|
||||
LEFT JOIN series s
|
||||
ON m.event_contract = s.event_contract
|
||||
AND e.series_id = s.series_id
|
||||
LEFT JOIN nft_sets sn
|
||||
ON m.event_contract = sn.event_contract
|
||||
AND e.set_id = sn.set_id
|
||||
AND COALESCE(
|
||||
m.set_id,
|
||||
e.set_id
|
||||
) = sn.set_id
|
||||
LEFT JOIN series s
|
||||
ON m.event_contract = s.event_contract
|
||||
AND COALESCE(
|
||||
m.series_id,
|
||||
e.series_id,
|
||||
sn.series_id
|
||||
) = s.series_id
|
||||
|
||||
)
|
||||
SELECT
|
||||
*,
|
||||
|
||||
@ -40,8 +40,12 @@ SELECT
|
||||
block_timestamp,
|
||||
event_contract,
|
||||
event_data AS set_data,
|
||||
event_data :id :: STRING AS set_id,
|
||||
COALESCE(
|
||||
event_data :id :: STRING,
|
||||
event_data :setID :: STRING
|
||||
) AS set_id,
|
||||
event_data :name :: STRING AS set_name,
|
||||
event_data :series :: STRING AS series_id,
|
||||
_inserted_timestamp,
|
||||
_partition_by_block_id,
|
||||
{{ dbt_utils.generate_surrogate_key(
|
||||
|
||||
Loading…
Reference in New Issue
Block a user