mirror of
https://gitlab.com/cief-data/dbt_cloud.git
synced 2026-08-19 04:14:00 +00:00
45 lines
825 B
SQL
45 lines
825 B
SQL
-- IMPORTS
|
|
WITH wallets AS (
|
|
SELECT * FROM {{ source('src_exchange_mysql', 'wallets') }}
|
|
),
|
|
|
|
|
|
-- LOGIC
|
|
wallets_rename AS (
|
|
|
|
SELECT
|
|
wallets.id,
|
|
wallets.owner_type,
|
|
wallets.owner_id,
|
|
wallets.code,
|
|
wallets.currency_id,
|
|
wallets.amount,
|
|
wallets.deleted_at,
|
|
wallets.created_at,
|
|
wallets.updated_at,
|
|
current_timestamp() AS _dbt_ran_at
|
|
|
|
FROM wallets
|
|
),
|
|
|
|
|
|
-- FINAL
|
|
final__base_exchange__wallets AS (
|
|
|
|
SELECT
|
|
id,
|
|
owner_type,
|
|
owner_id,
|
|
code,
|
|
currency_id,
|
|
amount,
|
|
deleted_at,
|
|
created_at,
|
|
updated_at,
|
|
_dbt_ran_at
|
|
|
|
FROM wallets_rename
|
|
|
|
)
|
|
|
|
SELECT * FROM final__base_exchange__wallets |