Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Restore Deleted Deal Pipelines and Deal Pipeline Stages #94

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions models/stg_hubspot__deal.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,9 @@ models:
description: Used to determine the order in which the stages appear when viewed in HubSpot.

- name: is_active
description: Whether the pipeline stage is currently in use.
description: >
Whether the pipeline stage is currently in use. Since HubSpot hard deletes pipeline stages, this column
returns the inverse of _fivetran_deleted.

- name: is_closed_won
description: Whether the stage represents a Closed Won deal.
Expand Down Expand Up @@ -54,7 +56,9 @@ models:
description: Used to determine the order in which the pipelines appear when viewed in HubSpot

- name: is_active
description: Whether the stage is currently in use.
description: >
Whether the pipeline stage is currently in use. Since HubSpot hard deletes pipelines, this column
returns the inverse of _fivetran_deleted.

- name: pipeline_label
description: The human-readable label for the pipeline. The label is used when showing the pipeline in HubSpot.
Expand Down
4 changes: 1 addition & 3 deletions models/stg_hubspot__deal_pipeline.sql
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ with base as (
select
_fivetran_deleted,
_fivetran_synced,
active as is_active,
not coalesce(_fivetran_deleted, false) as is_active,
display_order,
label as pipeline_label,
cast(pipeline_id as {{ dbt.type_string() }}) as deal_pipeline_id
Expand All @@ -31,5 +31,3 @@ with base as (

select *
from fields
where not coalesce(_fivetran_deleted, false)

5 changes: 2 additions & 3 deletions models/stg_hubspot__deal_pipeline_stage.sql
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ with base as (
select
_fivetran_deleted,
_fivetran_synced,
active as is_active,
not coalesce(_fivetran_deleted, false) as is_active, as is_active,
closed_won as is_closed_won,
display_order,
label as pipeline_stage_label,
Expand All @@ -33,5 +33,4 @@ with base as (
)

select *
from fields
where not coalesce(_fivetran_deleted, false)
from fields