mirror of
https://github.com/FlipsideCrypto/sei-models.git
synced 2026-02-06 19:57:00 +00:00
final cleanup
This commit is contained in:
parent
9cbe3702eb
commit
d4dd3d4438
@ -16,7 +16,7 @@ SELECT
|
||||
tx_code,
|
||||
msgs,
|
||||
COALESCE (
|
||||
transactions_id,
|
||||
transactions_final_id,
|
||||
{{ dbt_utils.generate_surrogate_key(
|
||||
['tx_id']
|
||||
) }}
|
||||
|
||||
@ -142,7 +142,7 @@ SELECT
|
||||
lp_token_address,
|
||||
A._inserted_timestamp,
|
||||
COALESCE (
|
||||
lp_actions_levanna_id,
|
||||
lp_actions_levana_id,
|
||||
{{ dbt_utils.generate_surrogate_key(
|
||||
['tx_id','msg_index']
|
||||
) }}
|
||||
|
||||
@ -17,7 +17,7 @@ SELECT
|
||||
COALESCE (
|
||||
governance_votes_id,
|
||||
{{ dbt_utils.generate_surrogate_key(
|
||||
['_unique_id']
|
||||
['_unique_key']
|
||||
) }}
|
||||
) AS fact_governance_votes_id,
|
||||
COALESCE(
|
||||
|
||||
@ -20,7 +20,7 @@ SELECT
|
||||
COALESCE (
|
||||
staking_id,
|
||||
{{ dbt_utils.generate_surrogate_key(
|
||||
['_unique_id']
|
||||
['_unique_key']
|
||||
) }}
|
||||
) AS fact_staking_id,
|
||||
COALESCE(
|
||||
|
||||
@ -19,7 +19,7 @@ SELECT
|
||||
COALESCE (
|
||||
staking_rewards_id,
|
||||
{{ dbt_utils.generate_surrogate_key(
|
||||
['_unique_id']
|
||||
['_unique_key']
|
||||
) }}
|
||||
) AS fact_staking_rewards_id,
|
||||
COALESCE(
|
||||
|
||||
@ -5,10 +5,9 @@
|
||||
incremental_strategy = 'merge',
|
||||
merge_exclude_columns = ["inserted_timestamp"],
|
||||
cluster_by = ['block_timestamp::DATE','_inserted_timestamp::DATE'],
|
||||
post_hook = "ALTER TABLE {{ this }} ADD SEARCH OPTIMIZATION ON EQUALITY(msg_type, msg:attributes);",
|
||||
tags = ['core']
|
||||
) }}
|
||||
|
||||
{# post_hook = "ALTER TABLE {{ this }} ADD SEARCH OPTIMIZATION ON EQUALITY(msg_type, msg:attributes);", #}
|
||||
WITH b AS (
|
||||
|
||||
SELECT
|
||||
@ -147,7 +146,7 @@ SELECT
|
||||
msg_type,
|
||||
msg,
|
||||
{{ dbt_utils.generate_surrogate_key(
|
||||
['tx_id','msg_index']
|
||||
['a.tx_id','a.msg_index']
|
||||
) }} AS msgs_id,
|
||||
SYSDATE() AS inserted_timestamp,
|
||||
SYSDATE() AS modified_timestamp,
|
||||
|
||||
@ -78,7 +78,7 @@ SELECT
|
||||
) }} AS transactions_final_id,
|
||||
SYSDATE() AS inserted_timestamp,
|
||||
SYSDATE() AS modified_timestamp,
|
||||
A._inserted_timestamp,
|
||||
t._inserted_timestamp,
|
||||
'{{ invocation_id }}' AS _invocation_id
|
||||
FROM
|
||||
{{ ref('silver__transactions') }}
|
||||
|
||||
@ -186,7 +186,7 @@ SELECT
|
||||
b.contract_address AS lp_token_address,
|
||||
{{ dbt_utils.generate_surrogate_key(
|
||||
['a.tx_id','a.msg_index']
|
||||
) }} AS dex_lp_actions_astroport_id,
|
||||
) }} AS lp_actions_astroport_id,
|
||||
SYSDATE() AS inserted_timestamp,
|
||||
SYSDATE() AS modified_timestamp,
|
||||
A._inserted_timestamp,
|
||||
|
||||
@ -159,7 +159,7 @@ SELECT
|
||||
d.lp_token_address,
|
||||
{{ dbt_utils.generate_surrogate_key(
|
||||
['a.tx_id','a.msg_index']
|
||||
) }} AS dex_lp_actions_fuzio_id,
|
||||
) }} AS lp_actions_fuzio_id,
|
||||
SYSDATE() AS inserted_timestamp,
|
||||
SYSDATE() AS modified_timestamp,
|
||||
A._inserted_timestamp,
|
||||
|
||||
@ -136,7 +136,7 @@ SELECT
|
||||
NULL AS lp_token_address,
|
||||
{{ dbt_utils.generate_surrogate_key(
|
||||
['a.tx_id','a.msg_index']
|
||||
) }} AS dex_lp_actions_levanna_id,
|
||||
) }} AS lp_actions_levana_id,
|
||||
SYSDATE() AS inserted_timestamp,
|
||||
SYSDATE() AS modified_timestamp,
|
||||
A._inserted_timestamp,
|
||||
|
||||
@ -146,7 +146,7 @@ SELECT
|
||||
C.lp_token_address,
|
||||
{{ dbt_utils.generate_surrogate_key(
|
||||
['a.tx_id','a.msg_index']
|
||||
) }} AS dex_lp_actions_seaswap_id,
|
||||
) }} AS lp_actions_seaswap_id,
|
||||
SYSDATE() AS inserted_timestamp,
|
||||
SYSDATE() AS modified_timestamp,
|
||||
A._inserted_timestamp,
|
||||
|
||||
@ -114,7 +114,7 @@ SELECT
|
||||
v.amount :: FLOAT AS amount,
|
||||
v.currency,
|
||||
{{ dbt_utils.generate_surrogate_key(
|
||||
['tx_id']
|
||||
['v.tx_id']
|
||||
) }} AS governance_proposal_deposits_id,
|
||||
SYSDATE() AS inserted_timestamp,
|
||||
SYSDATE() AS modified_timestamp,
|
||||
|
||||
@ -115,7 +115,7 @@ COALESCE(
|
||||
) :: STRING AS proposal_description,
|
||||
#}
|
||||
{{ dbt_utils.generate_surrogate_key(
|
||||
['tx_id']
|
||||
['p.tx_id']
|
||||
) }} AS governance_submit_proposal_id,
|
||||
SYSDATE() AS inserted_timestamp,
|
||||
SYSDATE() AS modified_timestamp,
|
||||
|
||||
@ -229,6 +229,5 @@ SELECT
|
||||
SYSDATE() AS modified_timestamp,
|
||||
A._inserted_timestamp,
|
||||
'{{ invocation_id }}' AS _invocation_id
|
||||
FROM
|
||||
FROM
|
||||
prefinal A
|
||||
|
||||
Loading…
Reference in New Issue
Block a user