Skip to content

Commit

Permalink
fix models
Browse files Browse the repository at this point in the history
  • Loading branch information
btkcodedev committed Sep 8, 2024
1 parent 6b37de9 commit 15bfdfe
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 10 deletions.
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@

SELECT
id AS contact_id,
_fivetran_deleted AS is_contact_deleted,
properties_hs_is_contact AS is_contact_deleted,
properties_hs_calculated_merged_vids AS calculated_merged_vids,
properties_email AS email,
properties_company AS contact_company,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
SELECT
{{ dbt.current_timestamp() }} AS _fivetran_synced,
canonical-vid AS contact_id,
source_id AS contact_id,
name AS field_name,
source AS change_source,
source_id AS change_source_id,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
SELECT
{{ dbt.current_timestamp() }} AS _fivetran_synced,
"appId" AS app_id,
CAST(caused_by->>'created' AS {{ dbt.type_timestamp() }}) AS caused_timestamp,
caused_by->>'id' AS caused_by_event_id,
CAST(causedBy->>'created' AS {{ dbt.type_timestamp() }}) AS caused_timestamp,
causedBy->>'id' AS caused_by_event_id,
CAST(created AS {{ dbt.type_timestamp() }}) AS created_timestamp,
"emailCampaignId" AS email_campaign_id,
"filteredEvent" AS is_filtered_event,
Expand All @@ -24,8 +24,8 @@ FROM
SELECT
{{ dbt.current_timestamp() }} AS _fivetran_synced,
appId AS app_id,
CAST(caused_by:created AS {{ dbt.type_timestamp() }}) AS caused_timestamp,
caused_by:id AS caused_by_event_id,
CAST(causedBy:created AS {{ dbt.type_timestamp() }}) AS caused_timestamp,
causedBy:id AS caused_by_event_id,
CAST(created AS {{ dbt.type_timestamp() }}) AS created_timestamp,
emailCampaignId AS email_campaign_id,
filteredEvent AS is_filtered_event,
Expand All @@ -45,8 +45,8 @@ FROM
SELECT
{{ dbt.current_timestamp() }} AS _fivetran_synced,
appId AS app_id,
CAST(JSON_EXTRACT_SCALAR(caused_by, '$.created') AS {{ dbt.type_timestamp() }}) AS caused_timestamp,
JSON_EXTRACT_SCALAR(caused_by, '$.id') AS caused_by_event_id,
CAST(JSON_EXTRACT_SCALAR(causedBy, '$.created') AS {{ dbt.type_timestamp() }}) AS caused_timestamp,
JSON_EXTRACT_SCALAR(causedBy, '$.id') AS caused_by_event_id,
CAST(created AS {{ dbt.type_timestamp() }}) AS created_timestamp,
emailCampaignId AS email_campaign_id,
filteredEvent AS is_filtered_event,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
SELECT
{{ dbt.current_timestamp() }} AS _fivetran_synced,
COALESCE(_fivetran_deleted, FALSE) AS _fivetran_deleted,
'FALSE' AS _fivetran_deleted,
id AS engagement_id,
'CALL' AS engagement_type,
createdAt AS created_timestamp,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
SELECT
{{ dbt.current_timestamp() }} AS _fivetran_synced,
COALESCE(_fivetran_deleted, FALSE) AS _fivetran_deleted,
'FALSE' AS _fivetran_deleted,
'EMAIL' AS engagement_type,
id AS engagement_id,
createdAt AS created_timestamp,
Expand Down

0 comments on commit 15bfdfe

Please sign in to comment.