mirror of
https://gitlab.com/cief-data/dbt_cloud.git
synced 2026-08-19 04:14:00 +00:00
42 lines
708 B
SQL
42 lines
708 B
SQL
-- IMPORTS
|
|
WITH files AS (
|
|
SELECT * FROM {{ source('src_exchange_mysql', 'files') }}
|
|
),
|
|
|
|
|
|
-- LOGIC
|
|
files_rename AS (
|
|
|
|
SELECT
|
|
files.id,
|
|
files.document_id,
|
|
files.file,
|
|
files.file_type,
|
|
files.deleted_at,
|
|
files.created_at,
|
|
files.updated_at,
|
|
current_timestamp() AS _dbt_ran_at
|
|
|
|
FROM files
|
|
|
|
),
|
|
|
|
|
|
-- FINAL
|
|
final__base_exchange__files AS (
|
|
|
|
SELECT
|
|
id,
|
|
document_id,
|
|
file,
|
|
file_type,
|
|
deleted_at,
|
|
created_at,
|
|
updated_at,
|
|
_dbt_ran_at
|
|
|
|
FROM files_rename
|
|
|
|
)
|
|
|
|
SELECT * FROM final__base_exchange__files |