diff --git a/warehouse/dbt/models/ethereum_attestation_service_sources.yml b/warehouse/dbt/models/ethereum_attestation_service_sources.yml new file mode 100644 index 00000000..e0af75b6 --- /dev/null +++ b/warehouse/dbt/models/ethereum_attestation_service_sources.yml @@ -0,0 +1,7 @@ +sources: + - name: ethereum_attestation_service_optimism + database: opensource-observer + schema: ethereum_attestation_service_optimism + tables: + - name: attestations + identifier: attestations diff --git a/warehouse/dbt/models/staging/ethereum_attestation_service/stg_ethereum_attestation_service__optimism.sql b/warehouse/dbt/models/staging/ethereum_attestation_service/stg_ethereum_attestation_service__optimism.sql new file mode 100644 index 00000000..4ab76785 --- /dev/null +++ b/warehouse/dbt/models/staging/ethereum_attestation_service/stg_ethereum_attestation_service__optimism.sql @@ -0,0 +1,19 @@ +select + id, + attester, + recipient, + ref_uid, + schema_id, + decoded_data_json, + revocable, + revoked, + is_offchain, + txid as transaction_hash, + timestamp_seconds(`time`) as `time`, + case + when expiration_time != 0 then timestamp_seconds(expiration_time) + end as expiration_time, + case + when revocation_time != 0 then timestamp_seconds(revocation_time) + end as revocation_time +from {{ source("ethereum_attestation_service_optimism", "attestations") }}