# Recurly schema ERD

Table and field reference for the Fivetran Recurly connector.

## Table & Field Reference

### external_account_history

| Column | Type | Keys |
| --- | --- | --- |
| index | Unknown | PK |
| account_id | Unknown | PK, FK |
| account_updated_at | Instant | PK, FK |
| created_at | Unknown |  |
| external_account_code | Unknown |  |
| external_connection_type | Unknown |  |
| id | Unknown |  |
| updated_at | Unknown |  |

### billing_info_history

| Column | Type | Keys |
| --- | --- | --- |
| id | Unknown | PK |
| updated_at | Unknown | PK |
| account_id | Unknown | FK |
| backup_payment_method | Unknown |  |
| billing_city | Unknown |  |
| billing_country | Unknown |  |
| billing_first_name | Unknown |  |
| billing_geo_code | Unknown |  |
| billing_last_name | Unknown |  |
| billing_phone | Unknown |  |
| billing_postal_code | Unknown |  |
| billing_region | Unknown |  |
| billing_street_1 | Unknown |  |
| billing_street_2 | Unknown |  |
| company | Unknown |  |
| created_at | Unknown |  |
| first_name | Unknown |  |
| fraud_decision | Unknown |  |
| fraud_risk_rules_triggered | Json |  |
| fraud_score | Unknown |  |
| last_name | Unknown |  |
| payment_gateway_references | Json |  |
| payment_method_account_type | Unknown |  |
| payment_method_billing_agreement_id | Unknown |  |
| payment_method_card_network_preference | Unknown |  |
| payment_method_card_type | Unknown |  |
| payment_method_cc_bin_country | Unknown |  |
| payment_method_exp_month | Unknown |  |
| payment_method_exp_year | Unknown |  |
| payment_method_first_six | Unknown |  |
| payment_method_funding_source | Unknown |  |
| payment_method_gateway_attributes_account_reference | Unknown |  |
| payment_method_gateway_code | Unknown |  |
| payment_method_gateway_token | Unknown |  |
| payment_method_last_four | Unknown |  |
| payment_method_last_two | Unknown |  |
| payment_method_name_on_account | Unknown |  |
| payment_method_object | Unknown |  |
| payment_method_routing_number | Unknown |  |
| payment_method_routing_number_bank | Unknown |  |
| payment_method_username | Unknown |  |
| primary_payment_method | Unknown |  |
| updated_by_country | Unknown |  |
| updated_by_ip | Unknown |  |
| valid | Unknown |  |
| vat_number | Unknown |  |

### shipping_address_history

| Column | Type | Keys |
| --- | --- | --- |
| id | Unknown | PK |
| updated_at | Unknown | PK |
| account_id | Unknown | PK, FK |
| city | Unknown |  |
| company | Unknown |  |
| country | Unknown |  |
| created_at | Unknown |  |
| email | Unknown |  |
| first_name | Unknown |  |
| geo_code | Unknown |  |
| last_name | Unknown |  |
| nickname | Unknown |  |
| phone | Unknown |  |
| postal_code | Unknown |  |
| region | Unknown |  |
| street_1 | Unknown |  |
| street_2 | Unknown |  |
| vat_number | Unknown |  |

### account_history

| Column | Type | Keys |
| --- | --- | --- |
| id | Unknown | PK |
| updated_at | Instant | PK |
| parent_account_id | Unknown | FK |
| account_city | Unknown |  |
| account_country | Unknown |  |
| account_geo_code | Unknown |  |
| account_phone | Unknown |  |
| account_postal_code | Unknown |  |
| account_region | Unknown |  |
| account_street_1 | Unknown |  |
| account_street_2 | Unknown |  |
| bill_date | Unknown |  |
| bill_to | Unknown |  |
| cc_emails | Unknown |  |
| code | Unknown |  |
| company | Unknown |  |
| created_at | Unknown |  |
| deleted_at | Unknown |  |
| dunning_campaign_id | Unknown |  |
| email | Unknown |  |
| entity_use_code | Unknown |  |
| exemption_certificate | Unknown |  |
| first_name | Unknown |  |
| has_active_subscription | Unknown |  |
| has_canceled_subscription | Unknown |  |
| has_future_subscription | Unknown |  |
| has_live_subscription | Unknown |  |
| has_past_due_invoice | Unknown |  |
| has_paused_subscription | Unknown |  |
| hosted_login_token | Unknown |  |
| invoice_template_id | Unknown |  |
| last_name | Unknown |  |
| override_business_entity_id | Unknown |  |
| preferred_locale | Unknown |  |
| preferred_time_zone | Unknown |  |
| state | Unknown |  |
| tax_exempt | Unknown |  |
| username | Unknown |  |
| vat_number | Unknown |  |
| custom_** |  |  |

### bulk_unique_code

| Column | Type | Keys |
| --- | --- | --- |
| id | Unknown | PK |
| bulk_code | Unknown | PK, FK |
| bulk_coupon_id | Unknown |  |
| code | Unknown |  |
| created_at | Unknown |  |
| expired_at | Unknown |  |
| object | Unknown |  |
| redeemed_at | Unknown |  |
| state | Unknown |  |
| updated_at | Instant |  |

### subscription_add_on_history

| Column | Type | Keys |
| --- | --- | --- |
| id | Unknown | PK |
| updated_at | Unknown | PK |
| plan_add_on_id | Unknown | FK |
| subscription_id | Unknown | FK |
| add_on_source | Unknown |  |
| created_at | Unknown |  |
| expired_at | Unknown |  |
| object | Unknown |  |
| quantity | Unknown |  |
| unit_amount | Unknown |  |
| unit_amount_decimal | Unknown |  |

### subscription_change_history

| Column | Type | Keys |
| --- | --- | --- |
| id | Unknown | PK |
| updated_at | Unknown | PK |
| plan_id | Unknown | FK |
| subscription_id | Unknown | FK |
| activate_at | Unknown |  |
| activated | Unknown |  |
| billing_info_three_d_secure_action_result_token_id | Unknown |  |
| created_at | Unknown |  |
| deleted_at | Unknown |  |
| object | Unknown |  |
| quantity | Unknown |  |
| tax_inclusive | Unknown |  |
| unit_amount | Unknown |  |

### subscription_ramp_interval

| Column | Type | Keys |
| --- | --- | --- |
| index | Unknown | PK |
| subscription_id | Unknown | PK, FK |
| subscription_updated_at | Unknown | PK, FK |
| ending_on | Unknown |  |
| remaining_billing_cycles | Unknown |  |
| starting_billing_cycle | Unknown |  |
| starting_on | Unknown |  |
| unit_amount | Unknown |  |

### subscription_credit_invoice

| Column | Type | Keys |
| --- | --- | --- |
| index | Unknown | PK |
| subscription_id | Unknown | PK, FK |
| subscription_updated_at | Unknown | PK, FK |
| credit_invoice_id | Unknown | FK |

### subscription_coupon_redemption_history

| Column | Type | Keys |
| --- | --- | --- |
| coupon_redemption_id | Unknown | PK, FK |
| subscription_history_id | Unknown | PK, FK |
| subscription_updated_at | Unknown | PK, FK |

### subscription_history

| Column | Type | Keys |
| --- | --- | --- |
| id | Unknown | PK |
| updated_at | Unknown | PK |
| account_id | Unknown | FK |
| active_invoice_id | Unknown | FK |
| invoice_collection_charge_invoice_id | Unknown | FK |
| plan_id | Unknown | FK |
| shipping_address_id | Unknown | FK |
| action_result | Json |  |
| activated_at | Unknown |  |
| add_ons_total | Unknown |  |
| auto_renew | Unknown |  |
| bank_account_authorized_at | Unknown |  |
| billing_info_id | Unknown |  |
| business_entity_id | Unknown |  |
| canceled_at | Unknown |  |
| collection_method | Unknown |  |
| converted_at | Unknown |  |
| created_at | Unknown |  |
| credit_application_policy_mode | Unknown |  |
| currency | Unknown |  |
| current_period_ends_at | Unknown |  |
| current_period_started_at | Unknown |  |
| current_term_ends_at | Unknown |  |
| current_term_started_at | Unknown |  |
| customer_notes | Unknown |  |
| deleted_at | Unknown |  |
| expiration_reason | Unknown |  |
| expires_at | Unknown |  |
| gateway_code | Unknown |  |
| net_terms | Unknown |  |
| net_terms_type | Unknown |  |
| next_action | Unknown |  |
| object | Unknown |  |
| paused_at | Unknown |  |
| po_number | Unknown |  |
| price_segment_id | Unknown |  |
| quantity | Unknown |  |
| remaining_billing_cycles | Unknown |  |
| remaining_pause_cycles | Unknown |  |
| renewal_billing_cycles | Unknown |  |
| shipping_address_object | Unknown |  |
| shipping_amount | Unknown |  |
| shipping_method_code | Unknown |  |
| shipping_method_id | Unknown |  |
| shipping_method_name | Unknown |  |
| shipping_method_object | Unknown |  |
| started_with_gift | Unknown |  |
| state | Unknown |  |
| subtotal | Unknown |  |
| tax | Unknown |  |
| tax_inclusive | Unknown |  |
| terms_and_conditions | Unknown |  |
| total | Unknown |  |
| total_billing_cycles | Unknown |  |
| trial_ends_at | Unknown |  |
| trial_started_at | Unknown |  |
| unit_amount | Unknown |  |
| uuid | Unknown |  |
| custom_** |  |  |

### subscription_gift_card_mapping

| Column | Type | Keys |
| --- | --- | --- |
| updated_at | Unknown | PK, FK |
| uuid | Unknown | PK, FK |
| converted_at | Unknown |  |
| started_with_gift | Unknown |  |

### coupon_discount

| Column | Type | Keys |
| --- | --- | --- |
| _fivetran_id | String | PK |
| coupon_id | Unknown | PK |
| amount | Unknown |  |
| currency | Unknown |  |
| percentage | Unknown |  |
| trial_length | Unknown |  |
| trial_unit | Unknown |  |
| type | Unknown |  |

### coupon_plan_history

| Column | Type | Keys |
| --- | --- | --- |
| coupon_id | Unknown | PK, FK |
| coupon_updated_at | Instant | PK, FK |
| plan_id | Unknown | PK, FK |

### coupon_history

| Column | Type | Keys |
| --- | --- | --- |
| id | Unknown | PK |
| updated_at | Instant | PK |
| applies_to_all_plans | Unknown |  |
| applies_to_non_plan_charges | Unknown |  |
| code | Unknown |  |
| coupon_type | Unknown |  |
| created_at | Unknown |  |
| duration | Unknown |  |
| expired_at | Unknown |  |
| free_trial_amount | Unknown |  |
| free_trial_unit | Unknown |  |
| hosted_page_description | Unknown |  |
| invoice_description | Unknown |  |
| max_redemptions | Unknown |  |
| max_redemptions_per_account | Unknown |  |
| name | Unknown |  |
| redeem_by | Unknown |  |
| redemption_resource | Unknown |  |
| state | Unknown |  |
| temporal_amount | Unknown |  |
| temporal_unit | Unknown |  |
| unique_code_template | Unknown |  |
| unique_coupon_codes_count | Unknown |  |

### line_item_tax_detail

| Column | Type | Keys |
| --- | --- | --- |
| index | Unknown | PK |
| line_item_id | Unknown | PK, FK |
| line_item_updated_at | Instant | PK, FK |
| billable | Unknown |  |
| level | Unknown |  |
| name | Unknown |  |
| rate | Unknown |  |
| region | Unknown |  |
| tax | Unknown |  |
| type | Unknown |  |

### line_item_history

| Column | Type | Keys |
| --- | --- | --- |
| id | Unknown | PK |
| updated_at | Instant | PK |
| account_id | Unknown | FK |
| add_on_id | Unknown | FK |
| bill_for_account_id | Unknown | FK |
| invoice_id | Unknown | FK |
| original_line_item_invoice_id | Unknown | FK |
| plan_id | Unknown | FK |
| previous_line_item_id | Unknown | FK |
| shipping_address_id | Unknown | FK |
| subscription_id | Unknown | FK |
| accounting_code | Unknown |  |
| add_on_code | Unknown |  |
| amount | Unknown |  |
| avalara_service_type | Unknown |  |
| avalara_transaction_type | Unknown |  |
| created_at | Unknown |  |
| credit_applied | Unknown |  |
| credit_reason_code | Unknown |  |
| currency | Unknown |  |
| description | Unknown |  |
| destination_tax_address_source | Unknown |  |
| discount | Unknown |  |
| end_date | Unknown |  |
| external_sku | Unknown |  |
| harmonized_system_code | Unknown |  |
| invoice_number | Unknown |  |
| item_code | Unknown |  |
| item_id | Unknown |  |
| legacy_category | Unknown |  |
| liability_gl_account_code | Unknown |  |
| origin | Unknown |  |
| origin_tax_address_source | Unknown |  |
| performance_obligation_id | Unknown |  |
| plan_code | Unknown |  |
| product_code | Unknown |  |
| proration_rate | Unknown |  |
| quantity | Unknown |  |
| quantity_decimal | Unknown |  |
| refund | Unknown |  |
| refunded_quantity | Unknown |  |
| refunded_quantity_decimal | Unknown |  |
| revenue_gl_account_code | Unknown |  |
| start_date | Unknown |  |
| state | Unknown |  |
| subtotal | Unknown |  |
| tax | Unknown |  |
| tax_code | Unknown |  |
| tax_exempt | Unknown |  |
| tax_inclusive | Unknown |  |
| tax_rate | Unknown |  |
| tax_region | Unknown |  |
| tax_type | Unknown |  |
| taxable | Unknown |  |
| type | Unknown |  |
| unit_amount | Unknown |  |
| unit_amount_decimal | Unknown |  |
| uuid | Unknown |  |
| custom_** |  |  |

### account_acquisition_history

| Column | Type | Keys |
| --- | --- | --- |
| id | Unknown | PK |
| updated_at | Instant | PK |
| account_id | Unknown | FK |
| acquired_at | Unknown |  |
| campaign | Unknown |  |
| channel | Unknown |  |
| cost_account | Unknown |  |
| cost_currency | Unknown |  |
| created_at | Unknown |  |
| subchannel | Unknown |  |

### dummy_temp_us

| Column | Type | Keys |
| --- | --- | --- |
| account_history_temp_cred_migration_us_dummy_id | Unknown | PK |
| id | Unknown | PK |
| updated_at | Unknown | PK |

### account_balance_history

| Column | Type | Keys |
| --- | --- | --- |
| account_id | Unknown | PK |
| account_updated_at | Instant | PK |
| currency | Unknown | PK |
| amount | Unknown |  |
| available_credit_amount | Unknown |  |
| past_due | Unknown |  |
| processing_prepayment_amount | Unknown |  |

### invoice_transaction_history

| Column | Type | Keys |
| --- | --- | --- |
| invoice_id | Unknown | PK, FK |
| invoice_updated_at | Instant | PK, FK |
| transaction_id | Unknown | PK, FK |

### invoice_tax_detail

| Column | Type | Keys |
| --- | --- | --- |
| index | Unknown | PK |
| invoice_id | Unknown | PK, FK |
| invoice_updated_at | Instant | PK, FK |
| transaction_id | Unknown | FK |
| billable | Unknown |  |
| level | Unknown |  |
| name | Unknown |  |

### invoice_line_item

| Column | Type | Keys |
| --- | --- | --- |
| invoice_id | Unknown | PK, FK |
| invoice_updated_at | Instant | PK, FK |
| line_item_id | Unknown | PK, FK |

### invoice_subscription_history

| Column | Type | Keys |
| --- | --- | --- |
| invoice_id | Unknown | PK, FK |
| invoice_updated_at | Instant | PK, FK |
| subscription_id | Unknown | PK, FK |

### invoice_history

| Column | Type | Keys |
| --- | --- | --- |
| id | Unknown | PK |
| updated_at | Instant | PK |
| account_id | Unknown | FK |
| previous_invoice_id | Unknown | FK |
| address_city | Unknown |  |
| address_company | Unknown |  |
| address_country | Unknown |  |
| address_first_name | Unknown |  |
| address_geo_code | Unknown |  |
| address_last_name | Unknown |  |
| address_name_on_account | Unknown |  |
| address_phone | Unknown |  |
| address_postal_code | Unknown |  |
| address_region | Unknown |  |
| address_street_1 | Unknown |  |
| address_street_2 | Unknown |  |
| balance | Unknown |  |
| billing_info_id | Unknown |  |
| business_entity_id | Unknown |  |
| closed_at | Unknown |  |
| collection_method | Unknown |  |
| created_at | Unknown |  |
| credit_payments | Json |  |
| currency | Unknown |  |
| customer_notes | Unknown |  |
| discount | Unknown |  |
| due_at | Unknown |  |
| dunning_campaign_id | Unknown |  |
| dunning_events_sent | Unknown |  |
| final_dunning_event | Unknown |  |
| gateway_code | Unknown |  |
| has_more_line_items | Unknown |  |
| net_terms | Unknown |  |
| net_terms_type | Unknown |  |
| number | Unknown |  |
| object | Unknown |  |
| origin | Unknown |  |
| paid | Unknown |  |
| po_number | Unknown |  |
| reference_only_currency_conversion_currency | Unknown |  |
| reference_only_currency_conversion_date | Unknown |  |
| reference_only_currency_conversion_rate | Unknown |  |
| reference_only_currency_conversion_source | Unknown |  |
| reference_only_currency_conversion_subtotal_in_cents | Unknown |  |
| reference_only_currency_conversion_tax_in_cents | Unknown |  |
| refundable_amount | Unknown |  |
| shipping_address_account_id | Unknown |  |
| shipping_address_city | Unknown |  |
| shipping_address_company | Unknown |  |
| shipping_address_country | Unknown |  |
| shipping_address_created_at | Unknown |  |
| shipping_address_email | Unknown |  |
| shipping_address_first_name | Unknown |  |
| shipping_address_geo_code | Unknown |  |
| shipping_address_id | Unknown |  |
| shipping_address_last_name | Unknown |  |
| shipping_address_nickname | Unknown |  |
| shipping_address_object | Unknown |  |
| shipping_address_phone | Unknown |  |
| shipping_address_postal_code | Unknown |  |
| shipping_address_region | Unknown |  |
| shipping_address_street_1 | Unknown |  |
| shipping_address_street_2 | Unknown |  |
| shipping_address_updated_at | Unknown |  |
| shipping_address_vat_number | Unknown |  |
| state | Unknown |  |
| subtotal | Unknown |  |
| subtotal_after_discount | Unknown |  |
| tax | Unknown |  |
| tax_rate | Unknown |  |
| tax_region | Unknown |  |
| tax_type | Unknown |  |
| terms_and_conditions | Unknown |  |
| total | Unknown |  |
| type | Unknown |  |
| used_tax_service | Unknown |  |
| uuid | Unknown |  |
| vat_number | Unknown |  |
| vat_reverse_charge_notes | Unknown |  |

### plan_setup_fees

| Column | Type | Keys |
| --- | --- | --- |
| index | Unknown | PK |
| plan_id | Unknown | PK, FK |
| plan_updated_at | Instant | PK, FK |
| currency | Unknown |  |
| unit_amount | Unknown |  |

### plan_currency_history

| Column | Type | Keys |
| --- | --- | --- |
| currency | Unknown | PK |
| plan_id | Unknown | PK, FK |
| plan_updated_at | Instant | PK, FK |
| price_segment_id | Unknown |  |
| setup_fees | Unknown |  |
| tax_inclusive | Unknown |  |
| unit_amount | Unknown |  |

### plan_history

| Column | Type | Keys |
| --- | --- | --- |
| id | Unknown | PK |
| updated_at | Instant | PK |
| accounting_code | Unknown |  |
| allow_any_item_on_subscriptions | Unknown |  |
| auto_renew | Unknown |  |
| avalara_service_type | Unknown |  |
| avalara_transaction_type | Unknown |  |
| code | Unknown |  |
| created_at | Unknown |  |
| deleted_at | Unknown |  |
| description | Unknown |  |
| dunning_campaign_id | Unknown |  |
| harmonized_system_code | Unknown |  |
| hosted_page_bypass_confirmation | Unknown |  |
| hosted_page_cancel_url | Unknown |  |
| hosted_page_display_quantity | Unknown |  |
| hosted_page_success_url | Unknown |  |
| interval_length | Unknown |  |
| interval_unit | Unknown |  |
| liability_gl_account_id | Unknown |  |
| name | Unknown |  |
| performance_obligation_id | Unknown |  |
| pricing_model | Unknown |  |
| revenue_gl_account_id | Unknown |  |
| revenue_schedule_type | Unknown |  |
| setup_fee_accounting_code | Unknown |  |
| setup_fee_liability_gl_account_id | Unknown |  |
| setup_fee_performance_obligation_id | Unknown |  |
| setup_fee_revenue_gl_account_id | Unknown |  |
| setup_fee_revenue_schedule_type | Unknown |  |
| state | Unknown |  |
| tax_code | Unknown |  |
| tax_exempt | Unknown |  |
| total_billing_cycles | Unknown |  |
| trial_length | Unknown |  |
| trial_requires_billing_info | Unknown |  |
| trial_unit | Unknown |  |
| vertex_transaction_type | Unknown |  |
| custom_** |  |  |

### gift_card

| Column | Type | Keys |
| --- | --- | --- |
| id | Unknown | PK |
| gifter_account_id | Unknown | FK |
| liability_gl_account_id | Unknown | FK |
| purchase_invoice_id | Unknown | FK |
| recipient_account_id | Unknown | FK |
| redemption_invoice_id | Unknown | FK |
| revenue_gl_account_id | Unknown | FK |
| balance | Unknown |  |
| canceled_at | Unknown |  |
| created_at | Unknown |  |
| currency | Unknown |  |
| delivered_at | Unknown |  |
| delivery_address_city | Unknown |  |
| delivery_address_country | Unknown |  |
| delivery_address_geo_code | Unknown |  |
| delivery_address_phone | Unknown |  |
| delivery_address_postal_code | Unknown |  |
| delivery_address_region | Unknown |  |
| delivery_address_street_1 | Unknown |  |
| delivery_address_street_2 | Unknown |  |
| delivery_deliver_at | Unknown |  |
| delivery_email_address | Unknown |  |
| delivery_first_name | Unknown |  |
| delivery_gifter_name | Unknown |  |
| delivery_last_name | Unknown |  |
| delivery_method | Unknown |  |
| delivery_personal_message | Unknown |  |
| performance_obligation_id | Unknown |  |
| product_code | Unknown |  |
| redeemed_at | Unknown |  |
| redemption_code | Unknown |  |
| unit_amount | Unknown |  |
| updated_at | Unknown |  |

### invoice_coupon_redemption_history

| Column | Type | Keys |
| --- | --- | --- |
| coupon_redemption_id | Unknown | PK, FK |
| invoice_id | Unknown | PK, FK |
| invoice_updated_at | Instant | PK, FK |

### external_subscription_payment_phase

| Column | Type | Keys |
| --- | --- | --- |
| id | Unknown | PK |
| external_subscription_id | Unknown | PK, FK |
| amount | Unknown |  |
| created_at | Unknown |  |
| currency | Unknown |  |
| ending_billing_period_index | Unknown |  |
| ends_at | Unknown |  |
| object | Unknown |  |
| offer_name | Unknown |  |
| offer_type | Unknown |  |
| period_count | Unknown |  |
| period_length | Unknown |  |
| started_at | Unknown |  |
| starting_billing_period_index | Unknown |  |
| updated_at | Unknown |  |

### external_subscription

| Column | Type | Keys |
| --- | --- | --- |
| id | Unknown | PK |
| account_id | Unknown | FK |
| activated_at | Unknown |  |
| app_identifier | Unknown |  |
| auto_renew | Unknown |  |
| canceled_at | Unknown |  |
| created_at | Unknown |  |
| expires_at | Unknown |  |
| external_id | Unknown |  |
| external_product_reference_code | Unknown |  |
| external_product_reference_created_at | Unknown |  |
| external_product_reference_external_connection_type | Unknown |  |
| external_product_reference_id | Unknown |  |
| external_product_reference_object | Unknown |  |
| external_product_reference_updated_at | Unknown |  |
| imported | Unknown |  |
| in_grace_period | Unknown |  |
| last_purchased | Unknown |  |
| object | Unknown |  |
| quantity | Unknown |  |
| state | Unknown |  |
| test | Unknown |  |
| trial_ends_at | Unknown |  |
| trial_started_at | Unknown |  |
| updated_at | Instant |  |
| uuid | Unknown |  |

### account_note_history

| Column | Type | Keys |
| --- | --- | --- |
| id | Unknown | PK |
| account_id | Unknown | PK, FK |
| account_updated_at | Instant | PK, FK |
| created_at | Unknown |  |
| message | Unknown |  |
| object | Unknown |  |
| user_created_at | Unknown |  |
| user_deleted_at | Unknown |  |
| user_email | Unknown |  |
| user_first_name | Unknown |  |
| user_id | Unknown |  |
| user_last_name | Unknown |  |
| user_object | Unknown |  |
| user_time_zone | Unknown |  |

### credit_payment_history

| Column | Type | Keys |
| --- | --- | --- |
| id | Unknown | PK |
| updated_at | Instant | PK |
| account_id | Unknown | PK, FK |
| applied_to_invoice_id | Unknown | FK |
| original_credit_payment_id | Unknown | FK |
| original_invoice_id | Unknown | FK |
| refund_transaction_id | Unknown | FK |
| action | Unknown |  |
| amount | Unknown |  |
| created_at | Unknown |  |
| currency | Unknown |  |
| uuid | Unknown |  |
| voided_at | Unknown |  |

### usage_record_tiers

| Column | Type | Keys |
| --- | --- | --- |
| index | Unknown | PK |
| usage_record_id | Unknown | PK, FK |
| ending_quantity | Unknown |  |
| unit_amount | Unknown |  |
| unit_amount_decimal | Unknown |  |
| usage_percentage | Unknown |  |

### usage_record_percentage_tiers

| Column | Type | Keys |
| --- | --- | --- |
| index | Unknown | PK |
| usage_record_id | Unknown | PK, FK |
| ending_amount | Unknown |  |
| usage_percentage | Unknown |  |

### usage_record

| Column | Type | Keys |
| --- | --- | --- |
| id | Unknown | PK |
| subscription_id | Unknown | PK |
| subscription_plan_add_on_id | Unknown | PK |
| amount | Unknown |  |
| billed_at | Instant |  |
| created_at | Instant |  |
| measured_unit_id | Unknown |  |
| merchant_tag | Unknown |  |
| object | Unknown |  |
| recording_timestamp | Instant |  |
| tier_type | Unknown |  |
| unit_amount | Unknown |  |
| unit_amount_decimal | Unknown |  |
| updated_at | Instant |  |
| usage_percentage | Unknown |  |
| usage_timestamp | Instant |  |
| usage_type | Unknown |  |

### coupon_redemption_history

| Column | Type | Keys |
| --- | --- | --- |
| id | Unknown | PK |
| updated_at | Instant | PK |
| account_id | Unknown | FK |
| coupon_id | Unknown | FK |
| subscription_id | Unknown | FK |
| created_at | Unknown |  |
| currency | Unknown |  |
| discounted | Unknown |  |
| removed_at | Unknown |  |
| state | Unknown |  |

### transaction_fraud_info_risk_rules_triggered

| Column | Type | Keys |
| --- | --- | --- |
| index | Unknown | PK |
| transaction_id | Unknown | PK, FK |
| code | Unknown |  |
| message | Unknown |  |

### transaction_subscription

| Column | Type | Keys |
| --- | --- | --- |
| subscription_id | Unknown | PK |
| transaction_id | Unknown | PK, FK |

### transaction

| Column | Type | Keys |
| --- | --- | --- |
| id | Unknown | PK |
| account_id | Unknown | FK |
| invoice_id | Unknown | FK |
| original_transaction_id | Unknown | FK |
| voided_by_invoice_id | Unknown | FK |
| action_result | Json |  |
| amount | Unknown |  |
| avs_check | Unknown |  |
| backup_payment_method_used | Unknown |  |
| billing_city | Unknown |  |
| billing_country | Unknown |  |
| billing_first_name | Unknown |  |
| billing_geo_code | Unknown |  |
| billing_last_name | Unknown |  |
| billing_phone | Unknown |  |
| billing_postal_code | Unknown |  |
| billing_region | Unknown |  |
| billing_street_1 | Unknown |  |
| billing_street_2 | Unknown |  |
| collected_at | Unknown |  |
| collection_method | Unknown |  |
| created_at | Unknown |  |
| currency | Unknown |  |
| customer_message | Unknown |  |
| customer_message_locale | Unknown |  |
| cvv_check | Unknown |  |
| fraud_info_decision | Unknown |  |
| fraud_info_object | Unknown |  |
| fraud_info_reference | Unknown |  |
| fraud_info_score | Unknown |  |
| gateway_approval_code | Unknown |  |
| gateway_message | Unknown |  |
| gateway_reference | Unknown |  |
| gateway_response_code | Unknown |  |
| gateway_response_time | Unknown |  |
| gateway_response_values | Json |  |
| initiator | Unknown |  |
| ip_address_country | Unknown |  |
| ip_address_v_4 | Unknown |  |
| next_action_type | Unknown |  |
| next_action_value | Unknown |  |
| origin | Unknown |  |
| payment_gateway_id | Unknown |  |
| payment_gateway_name | Unknown |  |
| payment_gateway_type | Unknown |  |
| payment_method_account_type | Unknown |  |
| payment_method_billing_agreement_id | Unknown |  |
| payment_method_card_network_preference | Unknown |  |
| payment_method_card_type | Unknown |  |
| payment_method_cc_bin_country | Unknown |  |
| payment_method_exp_month | Unknown |  |
| payment_method_exp_year | Unknown |  |
| payment_method_first_six | Unknown |  |
| payment_method_funding_source | Unknown |  |
| payment_method_gateway_attribute_account_reference | Unknown |  |
| payment_method_gateway_code | Unknown |  |
| payment_method_gateway_token | Unknown |  |
| payment_method_last_four | Unknown |  |
| payment_method_last_two | Unknown |  |
| payment_method_name_on_account | Unknown |  |
| payment_method_object | Unknown |  |
| payment_method_routing_number | Unknown |  |
| payment_method_routing_number_bank | Unknown |  |
| payment_method_username | Unknown |  |
| refunded | Unknown |  |
| status | Unknown |  |
| status_code | Unknown |  |
| status_message | Unknown |  |
| success | Unknown |  |
| type | Unknown |  |
| updated_at | Instant |  |
| uuid | Unknown |  |
| voided_at | Unknown |  |

### dummy_temp

| Column | Type | Keys |
| --- | --- | --- |
| account_history_temp_cred_migration_dummy | Unknown | PK |
| id | Unknown | PK |
| updated_at | Unknown | PK |

### plan_add_on_currency_history

| Column | Type | Keys |
| --- | --- | --- |
| currency | Unknown | PK |
| plan_add_on_id | Unknown | PK, FK |
| plan_add_on_updated_at | Instant | PK, FK |
| tax_inclusive | Unknown |  |
| unit_amount | Unknown |  |
| unit_amount_decimal | Unknown |  |

### plan_add_on_tier_history

| Column | Type | Keys |
| --- | --- | --- |
| index | Unknown | PK |
| plan_add_on_id | Unknown | PK |
| plan_add_on_tier_index | Unknown | PK |
| plan_add_on_updated_at | Instant | PK |
| currency | Unknown |  |
| ending_quantity | Unknown |  |
| unit_amount | Unknown |  |
| unit_amount_decimal | Unknown |  |
| usage_percentage | Unknown |  |

### plan_add_on_currency_percentage_tier

| Column | Type | Keys |
| --- | --- | --- |
| index | Unknown | PK |
| plan_add_on_id | Unknown | PK |
| plan_add_on_percentage_tier_index | Unknown | PK |
| plan_add_on_updated_at | Instant | PK |
| currency | Unknown |  |
| ending_amount | Unknown |  |
| usage_percentage | Unknown |  |

### plan_add_on_history

| Column | Type | Keys |
| --- | --- | --- |
| id | Unknown | PK |
| updated_at | Instant | PK |
| plan_id | Unknown | FK |
| accounting_code | Unknown |  |
| add_on_type | Unknown |  |
| avalara_service_type | Unknown |  |
| avalara_transaction_type | Unknown |  |
| code | Unknown |  |
| created_at | Unknown |  |
| default_quantity | Unknown |  |
| deleted_at | Unknown |  |
| display_quantity | Unknown |  |
| external_sku | Unknown |  |
| harmonized_system_code | Unknown |  |
| item_code | Unknown |  |
| item_description | Unknown |  |
| item_id | Unknown |  |
| item_name | Unknown |  |
| item_object | Unknown |  |
| item_state | Unknown |  |
| liability_gl_account_id | Unknown |  |
| measured_unit_id | Unknown |  |
| name | Unknown |  |
| object | Unknown |  |
| optional | Unknown |  |
| performance_obligation_id | Unknown |  |
| revenue_gl_account_id | Unknown |  |
| state | Unknown |  |
| tax_code | Unknown |  |
| tier_type | Unknown |  |
| usage_calculation_type | Unknown |  |
| usage_percentage | Unknown |  |
| usage_timeframe | Unknown |  |
| usage_type | Unknown |  |

## Relationships

- external_account_history(account_updated_at) → account_history(updated_at)
- external_account_history(account_id) → account_history(id)
- billing_info_history(account_id) → account_history(id)
- shipping_address_history(account_id) → account_history(id)
- account_history(parent_account_id) → account_history(id)
- bulk_unique_code(bulk_code) → coupon_history(id)
- subscription_add_on_history(subscription_id) → subscription_history(id)
- subscription_add_on_history(plan_add_on_id) → plan_add_on_history(id)
- subscription_change_history(subscription_id) → subscription_history(id)
- subscription_change_history(plan_id) → plan_history(id)
- subscription_ramp_interval(subscription_id) → subscription_history(id)
- subscription_ramp_interval(subscription_updated_at) → subscription_history(updated_at)
- subscription_credit_invoice(credit_invoice_id) → invoice_history(id)
- subscription_credit_invoice(subscription_id) → subscription_history(id)
- subscription_credit_invoice(subscription_updated_at) → subscription_history(updated_at)
- subscription_coupon_redemption_history(coupon_redemption_id) → coupon_redemption_history(id)
- subscription_coupon_redemption_history(subscription_history_id) → subscription_history(id)
- subscription_coupon_redemption_history(subscription_updated_at) → subscription_history(updated_at)
- subscription_history(shipping_address_id) → shipping_address_history(id)
- subscription_history(active_invoice_id) → invoice_history(id)
- subscription_history(plan_id) → plan_history(id)
- subscription_history(invoice_collection_charge_invoice_id) → invoice_history(id)
- subscription_history(account_id) → account_history(id)
- subscription_gift_card_mapping(uuid) → subscription_history(uuid)
- subscription_gift_card_mapping(updated_at) → subscription_history(updated_at)
- coupon_plan_history(plan_id) → plan_history(id)
- coupon_plan_history(coupon_id) → coupon_history(id)
- coupon_plan_history(coupon_updated_at) → coupon_history(updated_at)
- line_item_tax_detail(line_item_id) → line_item_history(id)
- line_item_tax_detail(line_item_updated_at) → line_item_history(updated_at)
- line_item_history(previous_line_item_id) → line_item_history(id)
- line_item_history(subscription_id) → subscription_history(id)
- line_item_history(shipping_address_id) → shipping_address_history(id)
- line_item_history(add_on_id) → plan_add_on_history(id)
- line_item_history(plan_id) → plan_history(id)
- line_item_history(invoice_id) → invoice_history(id)
- line_item_history(bill_for_account_id) → account_history(id)
- line_item_history(original_line_item_invoice_id) → invoice_history(id)
- line_item_history(account_id) → account_history(id)
- account_acquisition_history(account_id) → account_history(id)
- invoice_transaction_history(transaction_id) → transaction(id)
- invoice_transaction_history(invoice_id) → invoice_history(id)
- invoice_transaction_history(invoice_updated_at) → invoice_history(updated_at)
- invoice_tax_detail(transaction_id) → transaction(id)
- invoice_tax_detail(invoice_id) → invoice_history(id)
- invoice_tax_detail(invoice_updated_at) → invoice_history(updated_at)
- invoice_line_item(line_item_id) → line_item_history(id)
- invoice_line_item(invoice_id) → invoice_history(id)
- invoice_line_item(invoice_updated_at) → invoice_history(updated_at)
- invoice_subscription_history(subscription_id) → subscription_history(id)
- invoice_subscription_history(invoice_id) → invoice_history(id)
- invoice_subscription_history(invoice_updated_at) → invoice_history(updated_at)
- invoice_history(previous_invoice_id) → invoice_history(id)
- invoice_history(account_id) → account_history(id)
- plan_setup_fees(plan_id) → plan_history(id)
- plan_setup_fees(plan_updated_at) → plan_history(updated_at)
- plan_currency_history(plan_id) → plan_history(id)
- plan_currency_history(plan_updated_at) → plan_history(updated_at)
- gift_card(purchase_invoice_id) → invoice_history(id)
- gift_card(redemption_invoice_id) → invoice_history(id)
- gift_card(gifter_account_id) → account_history(id)
- gift_card(revenue_gl_account_id) → account_history(id)
- gift_card(liability_gl_account_id) → account_history(id)
- gift_card(recipient_account_id) → account_history(id)
- invoice_coupon_redemption_history(coupon_redemption_id) → coupon_redemption_history(id)
- invoice_coupon_redemption_history(invoice_updated_at) → invoice_history(updated_at)
- invoice_coupon_redemption_history(invoice_id) → invoice_history(id)
- external_subscription_payment_phase(external_subscription_id) → external_subscription(id)
- external_subscription(account_id) → account_history(id)
- account_note_history(account_id) → account_history(id)
- account_note_history(account_updated_at) → account_history(updated_at)
- credit_payment_history(applied_to_invoice_id) → invoice_history(id)
- credit_payment_history(refund_transaction_id) → transaction(id)
- credit_payment_history(original_credit_payment_id) → transaction(id)
- credit_payment_history(account_id) → account_history(id)
- credit_payment_history(original_invoice_id) → invoice_history(id)
- usage_record_tiers(usage_record_id) → usage_record(id)
- usage_record_percentage_tiers(usage_record_id) → usage_record(id)
- coupon_redemption_history(subscription_id) → subscription_history(id)
- coupon_redemption_history(coupon_id) → coupon_history(id)
- coupon_redemption_history(account_id) → account_history(id)
- transaction_fraud_info_risk_rules_triggered(transaction_id) → transaction(id)
- transaction_subscription(transaction_id) → transaction(id)
- transaction(voided_by_invoice_id) → invoice_history(id)
- transaction(original_transaction_id) → transaction(id)
- transaction(invoice_id) → invoice_history(id)
- transaction(account_id) → account_history(id)
- plan_add_on_currency_history(plan_add_on_id) → plan_add_on_history(id)
- plan_add_on_currency_history(plan_add_on_updated_at) → plan_add_on_history(updated_at)
- plan_add_on_history(plan_id) → plan_history(id)
