Skip to content
This repository was archived by the owner on Jan 20, 2026. It is now read-only.
Merged
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
13 changes: 13 additions & 0 deletions .github/workflows/generate-docs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
name: 'generate dbt docs'
on:
pull_request:
types:
- labeled

jobs:
generate-docs:
if: github.event.label.name == 'docs:ready'
uses: fivetran/dbt_package_automations/.github/workflows/generate-docs.yml@main
secrets: inherit
with:
schema_var_name: recharge_schema
25 changes: 25 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,28 @@
# dbt_recharge_source v0.4.0

[PR #21](https://github.com/fivetran/dbt_recharge_source/pull/21) includes the following updates:

## Schema & Data Updates
**4 new columns -- 2 deprecated columns -- 6 potential breaking changes**

| Data Model | Change Type | Old Name | New Name | Notes |
| -------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------- | ---------------------------- | ---------------------------------------------------- | ---------------------------------------------------------------------------------------- |
| `stg_recharge__one_time_product` | Deprecated column | `_is_deleted` | `_is_deleted` | The column will continue to persist for the time being, but we encourage referencing the `_fivetran_deleted` column in its place. |
| `stg_recharge__one_time_product` | New column | `_fivetran_deleted` | | Boolean created by Fivetran to indicate whether the record has been deleted. |
| `stg_recharge__order` | Deprecated column | `_is_deleted` | `_is_deleted` | The column will continue to persist for the time being, but we encourage referencing the `_fivetran_deleted` column in its place. |
| `stg_recharge__order` | New column | `_fivetran_deleted` | | Boolean created by Fivetran to indicate whether the record has been deleted. **For dbt Core users: If this field is included in the `recharge__order_passthrough_columns` variable. It will need to be removed in order to avoid duplicate column compilation failures.** |
| `stg_recharge__charge` | New column | `_fivetran_deleted` | | Boolean created by Fivetran to indicate whether the record has been deleted. **For dbt Core users: If this field is included in the `recharge__charge_passthrough_columns` variable. It will need to be removed in order to avoid duplicate column compilation failures.** |
| `stg_recharge__customer` | New column | `_fivetran_deleted` | | Boolean created by Fivetran to indicate whether the record has been deleted. |

## Documentation
- Added all new column documentation in the relevant src_recharge.yml and stg_recharge.yml files.
- Updated all the deprecated column documentation in the relevant src_recharge.yml and stg_recharge.yml files.
- Added column documentation for the `billing_*` fields related to the `CUSTOMER` source and staging models.

## Under the Hood
- Included relevant updates to the impacted seed files for integration tests.
- Introduced the generate-docs github workflow for consistent docs generation.

# dbt_recharge_source v0.3.2
This release includes the following updates.

Expand Down
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@
same "printed page" as the copyright notice for easier
identification within third-party archives.

Copyright [yyyy] [name of copyright owner]
Copyright © 2025 Fivetran Inc.

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ Include the following recharge_source package version in your `packages.yml` fil
```yml
packages:
- package: fivetran/recharge_source
version: [">=0.3.0", "<0.4.0"] # we recommend using ranges to capture non-breaking changes automatically
version: [">=0.4.0", "<0.5.0"] # we recommend using ranges to capture non-breaking changes automatically
```

### Step 3: Define database and schema variables
Expand Down
2 changes: 1 addition & 1 deletion dbt_project.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@

name: 'recharge_source'
version: '0.3.2'
version: '0.4.0'
config-version: 2
require-dbt-version: [">=1.3.0", "<2.0.0"]

Expand Down
2 changes: 1 addition & 1 deletion docs/catalog.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion docs/manifest.json

Large diffs are not rendered by default.

1 change: 0 additions & 1 deletion docs/run_results.json

This file was deleted.

4 changes: 2 additions & 2 deletions integration_tests/dbt_project.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@ vars:
recharge_customer_identifier: "customer_data"
recharge_discount_identifier: "discount_data"
recharge_one_time_product_identifier: "one_time_product_data"
order: "{{ ref('order_data') }}" # Comment out for generating docs -- Uncomment this before sending to buildkite.
# recharge_order_identifier: "order_data" # Uncomment for generating docs -- Comment this out before sending to buildkite.
order: "{{ ref('order_data') }}" # @docs-ignore
# recharge_order_identifier: "order_data" # @docs-include
recharge_orders_identifier: "orders_data"
recharge_order_line_item_identifier: "order_line_item_data"
recharge_subscription_identifier: "subscription_data"
Expand Down
6 changes: 3 additions & 3 deletions integration_tests/seeds/charge_data.csv
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
ID,ADDRESS_ID,CUSTOMER_ID,CUSTOMER_HASH,NOTE,CREATED_AT,UPDATED_AT,PROCESSED_AT,SCHEDULED_AT,ORDERS_COUNT,EXTERNAL_ORDER_ID_ECOMMERCE,SUBTOTAL_PRICE,TAGS,TAX_LINES,TOTAL_DISCOUNTS,TOTAL_LINE_ITEMS_PRICE,TOTAL_PRICE,TOTAL_TAX,TOTAL_WEIGHT_GRAMS,TYPE,STATUS,TOTAL_REFUNDS,EXTERNAL_TRANSACTION_ID_PAYMENT_PROCESSOR,EMAIL,PAYMENT_PROCESSOR,HAS_UNCOMMITED_CHANGES,RETRY_DATE,ERROR_TYPE,ERROR,CHARGE_ATTEMPTS,EXTERNAL_VARIANT_ID_NOT_FOUND,CLIENT_DETAILS_BROWSER_IP,CLIENT_DETAILS_USER_AGENT,_FIVETRAN_SYNCED,LAST_CHARGE_ATTEMPT_DATE
400000001,300000001,90000001,d81234567891234567891234567890c,next order in sequence 7,2022-09-08T03:21:55Z,2022-09-08T03:21:56Z,,2022-11-13T05:00:00Z,1,,11.95,"Subscription, Subscription Recurring Order",1.99,0,11.95,11.95,1.99,100,RECURRING,QUEUED,,,name01@domain01.com,stripe,FALSE,,,,,,,,2022-09-08T04:21:39.798Z,2022-09-08T04:21:39.798Z
400000002,300000002,90000002,d81234567891234567891234567891b,next order in sequence 25,2022-11-08T03:13:09Z,2022-11-08T03:13:10Z,,2022-11-10T04:00:00Z,1,,9.95,"Subscription, Subscription Recurring Order",1.66,0,9.95,9.95,1.66,100,RECURRING,QUEUED,,,name02@domain02.com,braintree,FALSE,,,,,,,,2022-11-08T03:54:57.851Z,2022-09-08T04:21:39.798Z
ID,ADDRESS_ID,CUSTOMER_ID,CUSTOMER_HASH,NOTE,CREATED_AT,UPDATED_AT,PROCESSED_AT,SCHEDULED_AT,ORDERS_COUNT,EXTERNAL_ORDER_ID_ECOMMERCE,SUBTOTAL_PRICE,TAGS,TAX_LINES,TOTAL_DISCOUNTS,TOTAL_LINE_ITEMS_PRICE,TOTAL_PRICE,TOTAL_TAX,TOTAL_WEIGHT_GRAMS,TYPE,STATUS,TOTAL_REFUNDS,EXTERNAL_TRANSACTION_ID_PAYMENT_PROCESSOR,EMAIL,PAYMENT_PROCESSOR,HAS_UNCOMMITED_CHANGES,RETRY_DATE,ERROR_TYPE,ERROR,CHARGE_ATTEMPTS,EXTERNAL_VARIANT_ID_NOT_FOUND,CLIENT_DETAILS_BROWSER_IP,CLIENT_DETAILS_USER_AGENT,_FIVETRAN_SYNCED,LAST_CHARGE_ATTEMPT_DATE,_FIVETRAN_DELETED
400000001,300000001,90000001,d81234567891234567891234567890c,next order in sequence 7,2022-09-08T03:21:55Z,2022-09-08T03:21:56Z,,2022-11-13T05:00:00Z,1,,11.95,"Subscription, Subscription Recurring Order",1.99,0,11.95,11.95,1.99,100,RECURRING,QUEUED,,,name01@domain01.com,stripe,FALSE,,,,,,,,2022-09-08T04:21:39.798Z,2022-09-08T04:21:39.798Z,FALSE
400000002,300000002,90000002,d81234567891234567891234567891b,next order in sequence 25,2022-11-08T03:13:09Z,2022-11-08T03:13:10Z,,2022-11-10T04:00:00Z,1,,9.95,"Subscription, Subscription Recurring Order",1.66,0,9.95,9.95,1.66,100,RECURRING,QUEUED,,,name02@domain02.com,braintree,FALSE,,,,,,,,2022-11-08T03:54:57.851Z,2022-09-08T04:21:39.798Z,TRUE
6 changes: 3 additions & 3 deletions integration_tests/seeds/one_time_product_data.csv
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
ID,ADDRESS_ID,CUSTOMER_ID,IS_DELETED,CREATED_AT,UPDATED_AT,NEXT_CHARGE_SCHEDULED_AT,PRODUCT_TITLE,VARIANT_TITLE,PRICE,QUANTITY,EXTERNAL_PRODUCT_ID_ECOMMERCE,EXTERNAL_VARIANT_ID_ECOMMERCE,SKU,_FIVETRAN_SYNCED
900000001,300000001,90000001,FALSE,2021-03-18T16:53:11Z,2021-03-18T16:53:11Z,2021-05-13T00:00:00,Product Title 01,,15,1,4800000000001,4800000000003,,2022-04-14T22:36:02.77Z
900000002,300000001,90000002,FALSE,2021-03-19T12:04:15Z,2021-03-19T12:04:15Z,2021-04-05T00:00:00,Product Title 02,,15,1,4800000000002,4800000000004,,2022-04-14T22:36:02.77Z
ID,ADDRESS_ID,CUSTOMER_ID,IS_DELETED,CREATED_AT,UPDATED_AT,NEXT_CHARGE_SCHEDULED_AT,PRODUCT_TITLE,VARIANT_TITLE,PRICE,QUANTITY,EXTERNAL_PRODUCT_ID_ECOMMERCE,EXTERNAL_VARIANT_ID_ECOMMERCE,SKU,_FIVETRAN_SYNCED,_FIVETRAN_DELETED
900000001,300000001,90000001,FALSE,2021-03-18T16:53:11Z,2021-03-18T16:53:11Z,2021-05-13T00:00:00,Product Title 01,,15,1,4800000000001,4800000000003,,2022-04-14T22:36:02.77Z,FALSE
900000002,300000001,90000002,FALSE,2021-03-19T12:04:15Z,2021-03-19T12:04:15Z,2021-04-05T00:00:00,Product Title 02,,15,1,4800000000002,4800000000004,,2022-04-14T22:36:02.77Z,FALSE
6 changes: 3 additions & 3 deletions integration_tests/seeds/orders_data.csv
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
ID,CUSTOMER_ID,ADDRESS_ID,CHARGE_ID,IS_DELETED,EMAIL,TRANSACTION_ID,CHARGE_STATUS,IS_PREPAID,STATUS,TOTAL_PRICE,TYPE,EXTERNAL_ORDER_ID_ECOMMERCE,EXTERNAL_ORDER_NUMBER_ECOMMERCE,CREATED_AT,UPDATED_AT,PROCESSED_AT,SCHEDULED_AT,SHIPPED_DATE,_FIVETRAN_SYNCED
11000001,90000001,300000001,400000001,FALSE,name01@domain01.com,ch_3La00000000000000000001uS,SUCCESS,FALSE,SUCCESS,14.45,RECURRING,13000001,14000001,2022-08-24T05:27:25Z,2022-08-24T05:27:26Z,2022-08-24T05:27:27Z,2022-08-24T04:00:00Z,2022-08-24T05:27:27Z,2022-08-25T03:57:07.416Z
11000002,90000002,300000002,400000002,FALSE,name02@domain02.com,ch_3La00000000000000000002uS,SUCCESS,FALSE,SUCCESS,11.95,RECURRING,13000002,14000002,2022-08-24T05:07:12Z,2022-08-24T05:07:14Z,2022-08-24T05:07:15Z,2022-08-24T04:00:00Z,2022-08-24T05:07:15Z,2022-08-25T03:57:06.225Z
ID,CUSTOMER_ID,ADDRESS_ID,CHARGE_ID,IS_DELETED,EMAIL,TRANSACTION_ID,CHARGE_STATUS,IS_PREPAID,STATUS,TOTAL_PRICE,TYPE,EXTERNAL_ORDER_ID_ECOMMERCE,EXTERNAL_ORDER_NUMBER_ECOMMERCE,CREATED_AT,UPDATED_AT,PROCESSED_AT,SCHEDULED_AT,SHIPPED_DATE,_FIVETRAN_SYNCED,_FIVETRAN_DELETED
11000001,90000001,300000001,400000001,FALSE,name01@domain01.com,ch_3La00000000000000000001uS,SUCCESS,FALSE,SUCCESS,14.45,RECURRING,13000001,14000001,2022-08-24T05:27:25Z,2022-08-24T05:27:26Z,2022-08-24T05:27:27Z,2022-08-24T04:00:00Z,2022-08-24T05:27:27Z,2022-08-25T03:57:07.416Z,FALSE
11000002,90000002,300000002,400000002,FALSE,name02@domain02.com,ch_3La00000000000000000002uS,SUCCESS,FALSE,SUCCESS,11.95,RECURRING,13000002,14000002,2022-08-24T05:07:12Z,2022-08-24T05:07:14Z,2022-08-24T05:07:15Z,2022-08-24T04:00:00Z,2022-08-24T05:07:15Z,2022-08-25T03:57:06.225Z,FALSE
1 change: 1 addition & 0 deletions macros/get_charge_columns.sql
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@

{% set columns = [
{"name": "id", "datatype": dbt.type_int()},
{"name": "_fivetran_deleted", "datatype": dbt.type_boolean()},
{"name": "address_id", "datatype": dbt.type_int()},
{"name": "customer_id", "datatype": dbt.type_int()},
{"name": "customer_hash", "datatype": dbt.type_string()},
Expand Down
1 change: 1 addition & 0 deletions macros/get_order_columns.sql
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
{"name": "address_id", "datatype": dbt.type_int()},
{"name": "charge_id", "datatype": dbt.type_int()},
{"name": "is_deleted", "datatype": dbt.type_boolean()},
{"name": "_fivetran_deleted", "datatype": dbt.type_boolean()},
{"name": "email", "datatype": dbt.type_string()},
{"name": "transaction_id", "datatype": dbt.type_string()},
{"name": "charge_status", "datatype": dbt.type_string()},
Expand Down
1 change: 1 addition & 0 deletions macros/get_order_line_item_columns.sql
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@

{% set columns = [
{"name": "order_id", "datatype": dbt.type_int()},
{"name": "_fivetran_deleted", "datatype": dbt.type_boolean()},
{"name": "index", "datatype": dbt.type_int()},
{"name": "variant_title", "datatype": dbt.type_string()},
{"name": "title", "datatype": dbt.type_string()},
Expand Down
22 changes: 20 additions & 2 deletions models/src_recharge.yml
Original file line number Diff line number Diff line change
Expand Up @@ -155,6 +155,8 @@ sources:
description: The user agent detected during checkout.
- name: _fivetran_synced
description: "{{ doc('_fivetran_synced') }}"
- name: _fivetran_deleted
description: "{{ doc('_fivetran_deleted') }}"

- name: charge_discount
identifier: "{{ var('recharge_charge_discount_identifier','charge_discount') }}"
Expand Down Expand Up @@ -344,6 +346,16 @@ sources:
description: Boolean indicating if the customer has a credit card in dunning.
- name: tax_exempt
description: Boolean indicating if the customer is tax exempt.
- name: billing_first_name
description: First name associated with the billing details.
- name: billing_last_name
description: Last name associated with the billing details.
- name: billing_company
description: Company associated with the billing details.
- name: billing_city
description: City associated with the billing details.
- name: billing_country
description: Country associated with the billing details.
- name: _fivetran_deleted
description: "{{ doc('_fivetran_deleted') }}"
- name: _fivetran_synced
Expand Down Expand Up @@ -397,7 +409,9 @@ sources:
- name: customer_id
description: "{{ doc('customer_id') }}"
- name: is_deleted
description: Boolean indicating if the onetime is deleted.
description: This column has been deprecated as of July 2025 in favor of the `_fivetran_deleted` column. Boolean indicating if the onetime is deleted.
- name: _fivetran_deleted
description: "{{ doc('_fivetran_deleted') }}"
- name: created_at
description: The time the onetime item was first created.
- name: updated_at
Expand Down Expand Up @@ -438,7 +452,11 @@ sources:
- name: charge_id
description: The unique numeric identifier of the charge.
- name: is_deleted
description: Boolean indicating if the order (record) is deleted.
description: This column has been deprecated as of July 2025 in favor of the `_fivetran_deleted` column. Boolean indicating if the order (record) is deleted.
- name: _fivetran_deleted
description: "{{ doc('_fivetran_deleted') }}"
- name: created_at
description: The date and time when the order was created.
- name: email
description: The email address of the customer.
- name: transaction_id
Expand Down
22 changes: 20 additions & 2 deletions models/stg_recharge.yml
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,8 @@ models:
description: The IP address of the buyer detected in checkout.
- name: client_details_user_agent
description: The user agent detected during checkout.
- name: _fivetran_deleted
description: "{{ doc('_fivetran_deleted') }}"

- name: stg_recharge__charge_discount
description: Table of all charge discount codes.
Expand Down Expand Up @@ -359,6 +361,18 @@ models:
description: Boolean indicating if the customer has a credit card in dunning.
- name: tax_exempt
description: Boolean indicating if the customer is tax exempt.
- name: billing_first_name
description: First name associated with the billing details.
- name: billing_last_name
description: Last name associated with the billing details.
- name: billing_company
description: Company associated with the billing details.
- name: billing_city
description: City associated with the billing details.
- name: billing_country
description: Country associated with the billing details.
- name: _fivetran_deleted
description: "{{ doc('_fivetran_deleted') }}"

- name: stg_recharge__discount
description: Table of discounts that can be applied to a checkout, or that can be directly applied to an address.
Expand Down Expand Up @@ -408,7 +422,9 @@ models:
- name: customer_id
description: Unique numeric identifier for the customer the onetime purchase is tied to.
- name: is_deleted
description: Boolean indicating if the onetime is deleted.
description: This column has been deprecated as of July 2025 in favor of the `_fivetran_deleted` column. Boolean indicating if the onetime is deleted.
- name: _fivetran_deleted
description: "{{ doc('_fivetran_deleted') }}"
- name: one_time_created_at
description: The time the onetime item was first created.
- name: one_time_updated_at
Expand Down Expand Up @@ -473,7 +489,9 @@ models:
- name: address_id
description: "{{ doc('address_id') }}"
- name: is_deleted
description: Boolean indicating if the order (record) is deleted.
description: This column has been deprecated as of July 2025 in favor of the `_fivetran_deleted` column. Boolean indicating if the order (record) is deleted.
- name: _fivetran_deleted
description: "{{ doc('_fivetran_deleted') }}"

- name: stg_recharge__order_line_item
description: Table of all order line items. Each line containing information about an item in the order.
Expand Down
3 changes: 2 additions & 1 deletion models/stg_recharge__charge.sql
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,8 @@ final as (
client_details_user_agent,
tags,
error,
external_variant_id_not_found
external_variant_id_not_found,
_fivetran_deleted

{{ fivetran_utils.fill_pass_through_columns('recharge__charge_passthrough_columns') }}

Expand Down
3 changes: 2 additions & 1 deletion models/stg_recharge__customer.sql
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,8 @@ final as (
billing_last_name,
billing_company,
billing_city,
billing_country
billing_country,
_fivetran_deleted
from fields
where not coalesce(_fivetran_deleted, false)
)
Expand Down
3 changes: 2 additions & 1 deletion models/stg_recharge__one_time_product.sql
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,8 @@ final as (
id as one_time_product_id,
address_id,
customer_id,
is_deleted,
is_deleted, --Deprecated in favor of the _fivetran_deleted column.
_fivetran_deleted,
cast(created_at as {{ dbt.type_timestamp() }}) as one_time_created_at,
cast(updated_at as {{ dbt.type_timestamp() }}) as one_time_updated_at,
next_charge_scheduled_at as one_time_next_charge_scheduled_at,
Expand Down
3 changes: 2 additions & 1 deletion models/stg_recharge__order.sql
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,8 @@ final as (
cast(scheduled_at as {{ dbt.type_timestamp() }}) as order_scheduled_at,
cast(shipped_date as {{ dbt.type_timestamp() }}) as order_shipped_date,
address_id,
is_deleted
is_deleted, --Deprecated in favor of the _fivetran_deleted column.
_fivetran_deleted

{{ fivetran_utils.fill_pass_through_columns('recharge__order_passthrough_columns') }}

Expand Down