-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #6 from fivetran/feature/best-practice
Best Practices
- Loading branch information
Showing
44 changed files
with
1,242 additions
and
42 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
{% macro get_activity_change_data_value_columns() %} | ||
|
||
{% set columns = [ | ||
{"name": "_fivetran_synced", "datatype": dbt_utils.type_timestamp()}, | ||
{"name": "activity_date", "datatype": dbt_utils.type_timestamp()}, | ||
{"name": "activity_type_id", "datatype": dbt_utils.type_int()}, | ||
{"name": "api_method_name", "datatype": dbt_utils.type_string()}, | ||
{"name": "campaign_id", "datatype": dbt_utils.type_int()}, | ||
{"name": "id", "datatype": dbt_utils.type_string()}, | ||
{"name": "lead_id", "datatype": dbt_utils.type_int()}, | ||
{"name": "modifying_user", "datatype": dbt_utils.type_string()}, | ||
{"name": "new_value", "datatype": dbt_utils.type_string()}, | ||
{"name": "old_value", "datatype": dbt_utils.type_string()}, | ||
{"name": "primary_attribute_value", "datatype": dbt_utils.type_string()}, | ||
{"name": "primary_attribute_value_id", "datatype": dbt_utils.type_int()}, | ||
{"name": "reason", "datatype": dbt_utils.type_string()}, | ||
{"name": "request_id", "datatype": dbt_utils.type_string()}, | ||
{"name": "source", "datatype": dbt_utils.type_string()} | ||
] %} | ||
|
||
{{ return(columns) }} | ||
|
||
{% endmacro %} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
{% macro get_activity_click_email_columns() %} | ||
|
||
{% set columns = [ | ||
{"name": "_fivetran_synced", "datatype": dbt_utils.type_timestamp()}, | ||
{"name": "activity_date", "datatype": dbt_utils.type_timestamp()}, | ||
{"name": "activity_type_id", "datatype": dbt_utils.type_int()}, | ||
{"name": "campaign_id", "datatype": dbt_utils.type_int()}, | ||
{"name": "campaign_run_id", "datatype": dbt_utils.type_int()}, | ||
{"name": "choice_number", "datatype": dbt_utils.type_int()}, | ||
{"name": "device", "datatype": dbt_utils.type_string()}, | ||
{"name": "email_template_id", "datatype": dbt_utils.type_int()}, | ||
{"name": "id", "datatype": dbt_utils.type_string()}, | ||
{"name": "is_mobile_device", "datatype": "boolean"}, | ||
{"name": "lead_id", "datatype": dbt_utils.type_int()}, | ||
{"name": "link", "datatype": dbt_utils.type_string()}, | ||
{"name": "link_id", "datatype": dbt_utils.type_string()}, | ||
{"name": "platform", "datatype": dbt_utils.type_string()}, | ||
{"name": "primary_attribute_value", "datatype": dbt_utils.type_string()}, | ||
{"name": "primary_attribute_value_id", "datatype": dbt_utils.type_int()}, | ||
{"name": "step_id", "datatype": dbt_utils.type_int()}, | ||
{"name": "test_variant", "datatype": dbt_utils.type_int()}, | ||
{"name": "user_agent", "datatype": dbt_utils.type_string()} | ||
] %} | ||
|
||
{{ return(columns) }} | ||
|
||
{% endmacro %} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
{% macro get_activity_delete_lead_columns() %} | ||
|
||
{% set columns = [ | ||
{"name": "_fivetran_synced", "datatype": dbt_utils.type_timestamp()}, | ||
{"name": "activity_date", "datatype": dbt_utils.type_timestamp()}, | ||
{"name": "activity_type_id", "datatype": dbt_utils.type_int()}, | ||
{"name": "campaign", "datatype": dbt_utils.type_string()}, | ||
{"name": "campaign_id", "datatype": dbt_utils.type_int()}, | ||
{"name": "id", "datatype": dbt_utils.type_string()}, | ||
{"name": "lead_id", "datatype": dbt_utils.type_int()}, | ||
{"name": "primary_attribute_value", "datatype": dbt_utils.type_string()}, | ||
{"name": "primary_attribute_value_id", "datatype": dbt_utils.type_int()} | ||
] %} | ||
|
||
{{ return(columns) }} | ||
|
||
{% endmacro %} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
{% macro get_activity_email_bounced_columns() %} | ||
|
||
{% set columns = [ | ||
{"name": "_fivetran_synced", "datatype": dbt_utils.type_timestamp()}, | ||
{"name": "activity_date", "datatype": dbt_utils.type_timestamp()}, | ||
{"name": "activity_type_id", "datatype": dbt_utils.type_int()}, | ||
{"name": "campaign_id", "datatype": dbt_utils.type_int()}, | ||
{"name": "campaign_run_id", "datatype": dbt_utils.type_int()}, | ||
{"name": "category", "datatype": dbt_utils.type_int()}, | ||
{"name": "choice_number", "datatype": dbt_utils.type_int()}, | ||
{"name": "details", "datatype": dbt_utils.type_string()}, | ||
{"name": "email", "datatype": dbt_utils.type_string()}, | ||
{"name": "email_template_id", "datatype": dbt_utils.type_int()}, | ||
{"name": "id", "datatype": dbt_utils.type_string()}, | ||
{"name": "lead_id", "datatype": dbt_utils.type_int()}, | ||
{"name": "primary_attribute_value", "datatype": dbt_utils.type_string()}, | ||
{"name": "primary_attribute_value_id", "datatype": dbt_utils.type_int()}, | ||
{"name": "step_id", "datatype": dbt_utils.type_int()}, | ||
{"name": "subcategory", "datatype": dbt_utils.type_int()}, | ||
{"name": "test_variant", "datatype": dbt_utils.type_int()} | ||
] %} | ||
|
||
{{ return(columns) }} | ||
|
||
{% endmacro %} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
{% macro get_activity_email_delivered_columns() %} | ||
|
||
{% set columns = [ | ||
{"name": "_fivetran_synced", "datatype": dbt_utils.type_timestamp()}, | ||
{"name": "activity_date", "datatype": dbt_utils.type_timestamp()}, | ||
{"name": "activity_type_id", "datatype": dbt_utils.type_int()}, | ||
{"name": "campaign_id", "datatype": dbt_utils.type_int()}, | ||
{"name": "campaign_run_id", "datatype": dbt_utils.type_int()}, | ||
{"name": "choice_number", "datatype": dbt_utils.type_int()}, | ||
{"name": "email_template_id", "datatype": dbt_utils.type_int()}, | ||
{"name": "id", "datatype": dbt_utils.type_string()}, | ||
{"name": "lead_id", "datatype": dbt_utils.type_int()}, | ||
{"name": "primary_attribute_value", "datatype": dbt_utils.type_string()}, | ||
{"name": "primary_attribute_value_id", "datatype": dbt_utils.type_int()}, | ||
{"name": "step_id", "datatype": dbt_utils.type_int()}, | ||
{"name": "test_variant", "datatype": dbt_utils.type_int()} | ||
] %} | ||
|
||
{{ return(columns) }} | ||
|
||
{% endmacro %} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
{% macro get_activity_merge_leads_columns() %} | ||
|
||
{% set columns = [ | ||
{"name": "_fivetran_synced", "datatype": dbt_utils.type_timestamp()}, | ||
{"name": "activity_date", "datatype": dbt_utils.type_timestamp()}, | ||
{"name": "activity_type_id", "datatype": dbt_utils.type_int()}, | ||
{"name": "campaign_id", "datatype": dbt_utils.type_int()}, | ||
{"name": "id", "datatype": dbt_utils.type_string()}, | ||
{"name": "lead_id", "datatype": dbt_utils.type_int()}, | ||
{"name": "master_updated", "datatype": "boolean"}, | ||
{"name": "merge_ids", "datatype": dbt_utils.type_string()}, | ||
{"name": "merge_source", "datatype": dbt_utils.type_string()}, | ||
{"name": "merged_in_sales", "datatype": "boolean"}, | ||
{"name": "primary_attribute_value", "datatype": dbt_utils.type_string()}, | ||
{"name": "primary_attribute_value_id", "datatype": dbt_utils.type_int()} | ||
] %} | ||
|
||
{{ return(columns) }} | ||
|
||
{% endmacro %} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
{% macro get_activity_open_email_columns() %} | ||
|
||
{% set columns = [ | ||
{"name": "_fivetran_synced", "datatype": dbt_utils.type_timestamp()}, | ||
{"name": "activity_date", "datatype": dbt_utils.type_timestamp()}, | ||
{"name": "activity_type_id", "datatype": dbt_utils.type_int()}, | ||
{"name": "campaign_id", "datatype": dbt_utils.type_int()}, | ||
{"name": "campaign_run_id", "datatype": dbt_utils.type_int()}, | ||
{"name": "choice_number", "datatype": dbt_utils.type_int()}, | ||
{"name": "device", "datatype": dbt_utils.type_string()}, | ||
{"name": "email_template_id", "datatype": dbt_utils.type_int()}, | ||
{"name": "id", "datatype": dbt_utils.type_string()}, | ||
{"name": "is_mobile_device", "datatype": "boolean"}, | ||
{"name": "lead_id", "datatype": dbt_utils.type_int()}, | ||
{"name": "platform", "datatype": dbt_utils.type_string()}, | ||
{"name": "primary_attribute_value", "datatype": dbt_utils.type_string()}, | ||
{"name": "primary_attribute_value_id", "datatype": dbt_utils.type_int()}, | ||
{"name": "step_id", "datatype": dbt_utils.type_int()}, | ||
{"name": "test_variant", "datatype": dbt_utils.type_int()}, | ||
{"name": "user_agent", "datatype": dbt_utils.type_string()} | ||
] %} | ||
|
||
{{ return(columns) }} | ||
|
||
{% endmacro %} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
{% macro get_activity_send_email_columns() %} | ||
|
||
{% set columns = [ | ||
{"name": "_fivetran_synced", "datatype": dbt_utils.type_timestamp()}, | ||
{"name": "activity_date", "datatype": dbt_utils.type_timestamp()}, | ||
{"name": "activity_type_id", "datatype": dbt_utils.type_int()}, | ||
{"name": "campaign_id", "datatype": dbt_utils.type_int()}, | ||
{"name": "campaign_run_id", "datatype": dbt_utils.type_int()}, | ||
{"name": "choice_number", "datatype": dbt_utils.type_int()}, | ||
{"name": "email_template_id", "datatype": dbt_utils.type_int()}, | ||
{"name": "id", "datatype": dbt_utils.type_string()}, | ||
{"name": "lead_id", "datatype": dbt_utils.type_int()}, | ||
{"name": "primary_attribute_value", "datatype": dbt_utils.type_string()}, | ||
{"name": "primary_attribute_value_id", "datatype": dbt_utils.type_int()}, | ||
{"name": "step_id", "datatype": dbt_utils.type_int()}, | ||
{"name": "test_variant", "datatype": dbt_utils.type_int()} | ||
] %} | ||
|
||
{{ return(columns) }} | ||
|
||
{% endmacro %} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
{% macro get_activity_unsubscribe_email_columns() %} | ||
|
||
{% set columns = [ | ||
{"name": "_fivetran_synced", "datatype": dbt_utils.type_timestamp()}, | ||
{"name": "activity_date", "datatype": dbt_utils.type_timestamp()}, | ||
{"name": "activity_type_id", "datatype": dbt_utils.type_int()}, | ||
{"name": "campaign_id", "datatype": dbt_utils.type_int()}, | ||
{"name": "campaign_run_id", "datatype": dbt_utils.type_int()}, | ||
{"name": "client_ip_address", "datatype": dbt_utils.type_string()}, | ||
{"name": "email_template_id", "datatype": dbt_utils.type_int()}, | ||
{"name": "form_fields", "datatype": dbt_utils.type_string()}, | ||
{"name": "id", "datatype": dbt_utils.type_string()}, | ||
{"name": "lead_id", "datatype": dbt_utils.type_int()}, | ||
{"name": "primary_attribute_value", "datatype": dbt_utils.type_string()}, | ||
{"name": "primary_attribute_value_id", "datatype": dbt_utils.type_int()}, | ||
{"name": "query_parameters", "datatype": dbt_utils.type_string()}, | ||
{"name": "referrer_url", "datatype": dbt_utils.type_string()}, | ||
{"name": "test_variant", "datatype": dbt_utils.type_int()}, | ||
{"name": "user_agent", "datatype": dbt_utils.type_string()}, | ||
{"name": "webform_id", "datatype": dbt_utils.type_int()}, | ||
{"name": "webpage_id", "datatype": dbt_utils.type_int()} | ||
] %} | ||
|
||
{{ return(columns) }} | ||
|
||
{% endmacro %} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
{% macro get_campaign_columns() %} | ||
|
||
{% set columns = [ | ||
{"name": "_fivetran_synced", "datatype": dbt_utils.type_timestamp()}, | ||
{"name": "active", "datatype": "boolean"}, | ||
{"name": "created_at", "datatype": dbt_utils.type_timestamp()}, | ||
{"name": "description", "datatype": dbt_utils.type_string()}, | ||
{"name": "id", "datatype": dbt_utils.type_int()}, | ||
{"name": "name", "datatype": dbt_utils.type_string()}, | ||
{"name": "program_id", "datatype": dbt_utils.type_int()}, | ||
{"name": "program_name", "datatype": dbt_utils.type_string()}, | ||
{"name": "type", "datatype": dbt_utils.type_string()}, | ||
{"name": "updated_at", "datatype": dbt_utils.type_timestamp()}, | ||
{"name": "workspace_name", "datatype": dbt_utils.type_string()} | ||
] %} | ||
|
||
{{ return(columns) }} | ||
|
||
{% endmacro %} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
{% macro get_email_template_history_columns() %} | ||
|
||
{% set columns = [ | ||
{"name": "_fivetran_synced", "datatype": dbt_utils.type_timestamp()}, | ||
{"name": "created_at", "datatype": dbt_utils.type_timestamp()}, | ||
{"name": "description", "datatype": dbt_utils.type_string()}, | ||
{"name": "folder_folder_name", "datatype": dbt_utils.type_string()}, | ||
{"name": "folder_id", "datatype": dbt_utils.type_int()}, | ||
{"name": "folder_type", "datatype": dbt_utils.type_string()}, | ||
{"name": "folder_value", "datatype": dbt_utils.type_int()}, | ||
{"name": "from_email", "datatype": dbt_utils.type_string()}, | ||
{"name": "from_name", "datatype": dbt_utils.type_string()}, | ||
{"name": "id", "datatype": dbt_utils.type_int()}, | ||
{"name": "name", "datatype": dbt_utils.type_string()}, | ||
{"name": "operational", "datatype": "boolean"}, | ||
{"name": "program_id", "datatype": dbt_utils.type_int()}, | ||
{"name": "publish_to_msi", "datatype": "boolean"}, | ||
{"name": "reply_email", "datatype": dbt_utils.type_string()}, | ||
{"name": "status", "datatype": dbt_utils.type_string()}, | ||
{"name": "subject", "datatype": dbt_utils.type_string()}, | ||
{"name": "template", "datatype": dbt_utils.type_int()}, | ||
{"name": "text_only", "datatype": "boolean"}, | ||
{"name": "updated_at", "datatype": dbt_utils.type_timestamp()}, | ||
{"name": "url", "datatype": dbt_utils.type_string()}, | ||
{"name": "version", "datatype": dbt_utils.type_int()}, | ||
{"name": "web_view", "datatype": "boolean"}, | ||
{"name": "workspace", "datatype": dbt_utils.type_string()} | ||
] %} | ||
|
||
{{ return(columns) }} | ||
|
||
{% endmacro %} |
Oops, something went wrong.