diff --git a/models/gold/core__fact_tx_body_msgs.sql b/models/gold/core__fact_tx_body_msgs.sql new file mode 100644 index 0000000..3e2ba72 --- /dev/null +++ b/models/gold/core__fact_tx_body_msgs.sql @@ -0,0 +1,14 @@ +{{ config( + materialized = 'view' +) }} + +SELECT + block_id, + block_timestamp, + tx_id, + tx_succeeded, + msg_group AS msg_index, + msg_type, + msg +FROM + {{ ref('silver__tx_body_msgs') }} diff --git a/models/gold/core__fact_tx_body_msgs.yml b/models/gold/core__fact_tx_body_msgs.yml new file mode 100644 index 0000000..a3f297c --- /dev/null +++ b/models/gold/core__fact_tx_body_msgs.yml @@ -0,0 +1,33 @@ +version: 2 +models: + - name: core__fact_tx_body_msgs + description: Records of all messages within the transaction body from transactions that have occurred on Osmosis, dating back to the genesis block + columns: + - name: BLOCK_ID + description: "{{ doc('block_id') }}" + tests: + - dbt_expectations.expect_column_to_exist + - name: BLOCK_TIMESTAMP + description: "{{ doc('block_timestamp') }}" + tests: + - dbt_expectations.expect_column_to_exist + - name: TX_ID + description: "{{ doc('tx_id') }}" + tests: + - dbt_expectations.expect_column_to_exist + - name: TX_SUCCEEDED + description: "{{ doc('tx_succeeded') }}" + tests: + - dbt_expectations.expect_column_to_exist + - name: MSG_INDEX + description: "{{ doc('msg_index') }}" + tests: + - dbt_expectations.expect_column_to_exist + - name: MSG_TYPE + description: "{{ doc('msg_type') }}" + tests: + - dbt_expectations.expect_column_to_exist + - name: MSG + description: "The underlying json from the message or event within the transactions" + tests: + - dbt_expectations.expect_column_to_exist \ No newline at end of file diff --git a/models/silver/silver__tx_body_msgs.sql b/models/silver/silver__tx_body_msgs.sql index b1c0320..a801368 100644 --- a/models/silver/silver__tx_body_msgs.sql +++ b/models/silver/silver__tx_body_msgs.sql @@ -2,7 +2,7 @@ materialized = 'incremental', unique_key = "_unique_key", incremental_strategy = 'merge', - cluster_by = ['_inserted_timestamp::DATE'] + cluster_by = ['block_timestamp::DATE','_inserted_timestamp::DATE'] ) }} WITH b AS (