# RevOps schema ERD

Table and field reference for the Fivetran RevOps connector.

## Table & Field Reference

### invoice

| Column | Type | Keys |
| --- | --- | --- |
| id | String | PK |
| account_id | String | PK, FK |
| plan_id | String | FK |
| amount_due | String |  |
| amount_paid | String |  |
| amount_remaining | String |  |
| amount_total | String |  |
| application_fee_amount | String |  |
| auto_advance | Boolean |  |
| billed_period | String |  |
| billed_usage_filename | String |  |
| charge_automatically | Boolean |  |
| contract_id | String |  |
| contract_url | String |  |
| currency | String |  |
| days_until_due | Int |  |
| detailed_usage_url | String |  |
| end_date | String |  |
| event_logs_url | String |  |
| invoice_due_date | Instant |  |
| invoice_due_date_timestamp | Int |  |
| invoice_number | String |  |
| invoice_paid_date | Instant |  |
| invoice_paid_date_timestamp | Int |  |
| invoice_pdf_url | String |  |
| invoice_sent_date | Instant |  |
| invoice_sent_date_timestamp | Int |  |
| paid_out_of_band | Boolean |  |
| payment_term | String |  |
| plan_type | String |  |
| provider | String |  |
| provider_id | String |  |
| recognition_amount | String |  |
| recognition_end_date | String |  |
| recognition_start_date | String |  |
| start_date | String |  |
| status | String |  |
| uri | String |  |

### plan_tag

| Column | Type | Keys |
| --- | --- | --- |
| id | String | PK |
| plan_id | String | PK, FK |
| date_created | Instant |  |
| date_updated | Instant |  |
| description | String |  |
| icon | String |  |
| name | String |  |
| organization_id | String |  |
| status | String |  |
| type | String |  |

### term

| Column | Type | Keys |
| --- | --- | --- |
| internal_id | String | PK |
| plan_id | String | PK, FK |
| id | String | FK |
| creator_id | String |  |
| crm_object | String |  |
| crm_object_field | String |  |
| date_created | Instant |  |
| date_updated | Instant |  |
| default_value | String |  |
| description | String |  |
| hide_label | Boolean |  |
| icon | String |  |
| internal | Boolean |  |
| is_required | Boolean |  |
| is_standard | Boolean |  |
| label | String |  |
| label_content | String |  |
| name | String |  |
| options_text | String |  |
| options_value | String |  |
| orders | Int |  |
| organization_id | String |  |
| placeholder | String |  |
| renewal_behavior | String |  |
| show_in_proposal_body | Boolean |  |
| show_in_proposal_header | Boolean |  |
| term_category | String |  |
| type | String |  |
| value | String |  |

### rate_metric

| Column | Type | Keys |
| --- | --- | --- |
| id | String | PK |
| rate_id | String | PK, FK |
| divisor | Double |  |
| end_date_offset | Int |  |
| end_date_offset_period | String |  |
| friendly_name | String |  |
| metric_name | String |  |
| operator | String |  |
| organization_id | String |  |
| product | String |  |
| rounding_behavior | String |  |
| usage_period | String |  |

### rate_rate_table

| Column | Type | Keys |
| --- | --- | --- |
| id | String | PK |
| rate_id | String | FK |
| amount | String |  |
| monthly_rate | String |  |
| percentage | Double |  |
| quantity | String |  |
| quantity_max | String |  |
| quantity_min | String |  |
| rate | String |  |

### rate

| Column | Type | Keys |
| --- | --- | --- |
| id | String | PK |
| sku_id | String | PK, FK |
| end_date_offset | Int |  |
| end_date_offset_period | String |  |
| is_default | Boolean |  |
| name | String |  |
| usage_period | String |  |

### custom_property

| Column | Type | Keys |
| --- | --- | --- |
| id | String | PK |
| sku_id | String | PK, FK |
| enabled | Boolean |  |
| friendly_name | String |  |
| mode | String |  |
| value | String |  |

### sku

| Column | Type | Keys |
| --- | --- | --- |
| id | String | PK |
| plan_id | String | PK, FK |
| adjusted_annual_price | String |  |
| adjusted_monthly_price | String |  |
| adjusted_net_price | String |  |
| adjusted_price | String |  |
| annual_price | String |  |
| billing_end_date | String |  |
| billing_provider_month_plan_id | String |  |
| billing_provider_plan_id | String |  |
| billing_provider_product_id | String |  |
| billing_provider_year_plan_id | String |  |
| billing_start_date | String |  |
| color | String |  |
| contract_length | Int |  |
| creator_id | String |  |
| crm_id | String |  |
| crm_pricebook_2_id | String |  |
| crm_product_2_id | String |  |
| currency | String |  |
| default_quantity | Int |  |
| fraction_digits | Int |  |
| icon | String |  |
| is_discount | Boolean |  |
| ledger_code | String |  |
| line_item_description | String |  |
| line_item_title | String |  |
| list_price | String |  |
| monthly_price | String |  |
| name | String |  |
| net_price | String |  |
| orders | Int |  |
| organization_id | String |  |
| product_code | String |  |
| quantity | Int |  |
| show_public_discount | Boolean |  |
| sku_group | String |  |
| status | String |  |
| tax | String |  |
| tiering_model | String |  |
| tiering_model_type | String |  |
| tiering_type | String |  |
| type | String |  |
| unit_name | String |  |
| unit_pricing_schedule | String |  |
| updated_line_item_description | String |  |

### plan_group

| Column | Type | Keys |
| --- | --- | --- |
| id | String | PK |
| date_created | Instant |  |
| date_updated | Instant |  |
| description | String |  |
| icon | String |  |
| name | String |  |
| organization_id | String |  |
| status | String |  |
| type | String |  |

### plan

| Column | Type | Keys |
| --- | --- | --- |
| id | String | PK |
| plan_group_id | String | FK |
| billing_provider_subscription_id | String |  |
| cpq | Boolean |  |
| date_created | Instant |  |
| date_updated | Instant |  |
| friendly_name | String |  |
| interval | String |  |
| interval_count | Int |  |
| is_default | Boolean |  |
| public | String |  |
| status | String |  |
| uri | String |  |

### account

| Column | Type | Keys |
| --- | --- | --- |
| id | String | PK |
| parent_account_id | String | FK |
| plan_id | String | FK |
| account_id | String |  |
| auto_billing | String |  |
| base_contract_id | String |  |
| billing_contact_address | String |  |
| billing_contact_address_2 | String |  |
| billing_contact_bank_account_holder_name | String |  |
| billing_contact_bank_account_holder_type | String |  |
| billing_contact_bank_account_number | String |  |
| billing_contact_bank_country | String |  |
| billing_contact_bank_name | String |  |
| billing_contact_bank_routing_number | String |  |
| billing_contact_city | String |  |
| billing_contact_country | String |  |
| billing_contact_email | String |  |
| billing_contact_first_name | String |  |
| billing_contact_hubspot_contact_id | String |  |
| billing_contact_id | String |  |
| billing_contact_last_name | String |  |
| billing_contact_middle_name | String |  |
| billing_contact_payment_method | String |  |
| billing_contact_phone | String |  |
| billing_contact_postal_code | String |  |
| billing_contact_province | String |  |
| billing_contact_salesforce_contact_id | String |  |
| billing_contact_state | String |  |
| billing_contact_stripe_customer_id | String |  |
| billing_contact_title | String |  |
| blocked | Boolean |  |
| date_created | Instant |  |
| date_updated | Instant |  |
| email | String |  |
| in_contract | Boolean |  |
| name | String |  |
| payable | Boolean |  |
| primary_instrument_id | String |  |
| status | String |  |
| stripe_customer_id | String |  |
| uri | String |  |
| verified | Boolean |  |

### cost_rate_table

| Column | Type | Keys |
| --- | --- | --- |
| id | String | PK |
| cost_invoice_id | String | FK |
| amount | String |  |
| monthly_rate | String |  |
| percentage | Double |  |
| quantity | String |  |
| quantity_max | String |  |
| quantity_min | String |  |
| rate | String |  |

### usage_object

| Column | Type | Keys |
| --- | --- | --- |
| _fivetran_id | String | PK |
| cost_invoice_id | String | FK |
| amount | String |  |
| cumulative_sum | String |  |
| quantity | String |  |
| resource | String |  |
| time_stamp | String |  |
| unit_rate | String |  |

### cost

| Column | Type | Keys |
| --- | --- | --- |
| account_id | String | PK, FK |
| invoice_id | String | PK, FK |
| aggregate_amount | String |  |
| aggregate_quantity | String |  |
| currency | String |  |
| date_created | Instant |  |
| date_updated | Instant |  |
| description | String |  |
| end_date | Instant |  |
| is_lifetime | Boolean |  |
| pricing_schedule | String |  |
| provider_id | String |  |
| sku_type | String |  |
| start_date | Instant |  |
| status | String |  |

## Relationships

- invoice(plan_id) → plan(id)
- invoice(account_id) → account(id)
- plan_tag(plan_id) → plan(id)
- term(id) → sku(id)
- term(plan_id) → plan(id)
- rate_metric(rate_id) → rate(id)
- rate_rate_table(rate_id) → rate(id)
- rate(sku_id) → sku(id)
- custom_property(sku_id) → sku(id)
- sku(plan_id) → plan(id)
- plan(plan_group_id) → plan_group(id)
- account(plan_id) → plan(id)
- account(parent_account_id) → account(id)
- cost_rate_table(cost_invoice_id) → cost(invoice_id)
- usage_object(cost_invoice_id) → cost(invoice_id)
- cost(invoice_id) → invoice(id)
- cost(account_id) → account(id)
