# Harvest schema ERD

Table and field reference for the Fivetran Harvest connector.

## Table & Field Reference

### estimate_item_category

| Column | Type | Keys |
| --- | --- | --- |
| id | Unknown | PK |
| updated_at | Unknown | PK |
| created_at | Unknown |  |
| name | Unknown |  |

### contact

| Column | Type | Keys |
| --- | --- | --- |
| id | Unknown | PK |
| updated_at | Unknown | PK |
| client_id | Unknown | FK |
| created_at | Unknown |  |
| email | Unknown |  |
| fax | Unknown |  |
| first_name | Unknown |  |
| last_name | Unknown |  |
| phone_mobile | Unknown |  |
| phone_office | Unknown |  |
| title | Unknown |  |

### project_user_assignment

| Column | Type | Keys |
| --- | --- | --- |
| id | Unknown | PK |
| updated_at | Unknown | PK |
| project_id | Unknown | FK |
| user_id | Unknown | FK |
| budget | Unknown |  |
| created_at | Unknown |  |
| hourly_rate | Unknown |  |
| is_active | Unknown |  |
| is_project_manager | Unknown |  |
| use_default_rates | Unknown |  |

### role_user

| Column | Type | Keys |
| --- | --- | --- |
| role_user_id | Unknown | PK |
| role_id | Unknown | PK, FK |

### role

| Column | Type | Keys |
| --- | --- | --- |
| id | Unknown | PK |
| updated_at | Unknown | PK |
| created_at | Unknown |  |
| name | Unknown |  |

### time_entry

| Column | Type | Keys |
| --- | --- | --- |
| id | Unknown | PK |
| updated_at | Unknown | PK |
| client_id | Unknown | FK |
| invoice_id | Unknown | FK |
| project_id | Unknown | FK |
| task_assignment_id | Unknown | FK |
| task_id | Unknown | FK |
| user_assignment_id | Unknown | FK |
| user_id | Unknown | FK |
| billable | Unknown |  |
| billable_rate | Unknown |  |
| budgeted | Unknown |  |
| cost_rate | Unknown |  |
| created_at | Unknown |  |
| ended_time | Unknown |  |
| external_reference | Unknown |  |
| hours | Unknown |  |
| hours_without_timer | Unknown |  |
| is_billed | Unknown |  |
| is_closed | Unknown |  |
| is_locked | Unknown |  |
| is_running | Unknown |  |
| locked_reason | Unknown |  |
| notes | Unknown |  |
| rounded_hours | Unknown |  |
| spent_date | Unknown |  |
| started_time | Unknown |  |
| timer_started_at | Unknown |  |

### project_task_assignment

| Column | Type | Keys |
| --- | --- | --- |
| id | Unknown | PK |
| updated_at | Unknown | PK |
| project_id | Unknown | FK |
| task_id | Unknown | FK |
| billable | Unknown |  |
| budget | Unknown |  |
| created_at | Unknown |  |
| hourly_rate | Unknown |  |
| is_active | Unknown |  |

### invoice_item_category

| Column | Type | Keys |
| --- | --- | --- |
| id | Unknown | PK |
| updated_at | Unknown | PK |
| created_at | Unknown |  |
| name | Unknown |  |
| use_as_expense | Unknown |  |
| use_as_service | Unknown |  |

### invoice_message_recipient

| Column | Type | Keys |
| --- | --- | --- |
| email | Unknown | PK |
| invoice_message_id | Unknown | PK, FK |
| name | Unknown |  |

### invoice_message

| Column | Type | Keys |
| --- | --- | --- |
| id | Unknown | PK |
| updated_at | Unknown | PK |
| invoice_id | Unknown | FK |
| attach_pdf | Unknown |  |
| body | Unknown |  |
| created_at | Unknown |  |
| event_type | Unknown |  |
| include_link_to_client_invoice | Unknown |  |
| reminder | Unknown |  |
| send_me_a_copy | Unknown |  |
| send_reminder_on | Unknown |  |
| sent_by | Unknown |  |
| sent_by_email | Unknown |  |
| sent_from | Unknown |  |
| sent_from_email | Unknown |  |
| subject | Unknown |  |
| thank_you | Unknown |  |

### user_cost_rate

| Column | Type | Keys |
| --- | --- | --- |
| id | Unknown | PK |
| updated_at | Unknown | PK |
| users_id | Unknown | FK |
| amount | Unknown |  |
| created_at | Unknown |  |
| end_date | Unknown |  |
| start_date | Unknown |  |

### expense_category

| Column | Type | Keys |
| --- | --- | --- |
| id | Unknown | PK |
| updated_at | Unknown | PK |
| created_at | Unknown |  |
| is_active | Unknown |  |
| name | Unknown |  |
| unit_name | Unknown |  |
| unit_price | Unknown |  |

### user_project_assignment_task_assignment

| Column | Type | Keys |
| --- | --- | --- |
| id | Unknown | PK |
| updated_at | Unknown | PK |
| task_id | Unknown | FK |
| users_id | Unknown | FK |
| billable | Unknown |  |
| budget | Unknown |  |
| created_at | Unknown |  |
| hourly_rate | Unknown |  |
| is_active | Unknown |  |

### user_project_assignment

| Column | Type | Keys |
| --- | --- | --- |
| id | Unknown | PK |
| updated_at | Unknown | PK |
| client_id | Unknown | FK |
| project_id | Unknown | FK |
| users_id | Unknown | FK |
| budget | Unknown |  |
| created_at | Unknown |  |
| hourly_rate | Unknown |  |
| is_active | Unknown |  |
| is_project_manager | Unknown |  |
| use_default_rates | Unknown |  |

### task

| Column | Type | Keys |
| --- | --- | --- |
| id | Unknown | PK |
| updated_at | Unknown | PK |
| billable_by_default | Unknown |  |
| created_at | Unknown |  |
| default_hourly_rate | Unknown |  |
| is_active | Unknown |  |
| is_default | Unknown |  |
| name | Unknown |  |

### project

| Column | Type | Keys |
| --- | --- | --- |
| id | Unknown | PK |
| updated_at | Unknown | PK |
| client_id | Unknown | FK |
| bill_by | Unknown |  |
| budget | Unknown |  |
| budget_by | Unknown |  |
| budget_is_monthly | Unknown |  |
| code | Unknown |  |
| cost_budget | Unknown |  |
| cost_budget_include_expenses | Unknown |  |
| created_at | Unknown |  |
| ends_on | Unknown |  |
| fee | Unknown |  |
| hourly_rate | Unknown |  |
| is_active | Unknown |  |
| is_billable | Unknown |  |
| is_fixed_fee | Unknown |  |
| name | Unknown |  |
| notes | Unknown |  |
| notify_when_over_budget | Unknown |  |
| over_budget_notification_date | Unknown |  |
| over_budget_notification_percentage | Unknown |  |
| show_budget_to_all | Unknown |  |
| starts_on | Unknown |  |

### invoice_payment

| Column | Type | Keys |
| --- | --- | --- |
| id | Unknown | PK |
| updated_at | Unknown | PK |
| invoice_id | Unknown | FK |
| amount | Unknown |  |
| created_at | Unknown |  |
| notes | Unknown |  |
| paid_at | Unknown |  |
| paid_date | Unknown |  |
| payment_gateway_id | Unknown |  |
| payment_gateway_name | Unknown |  |
| recorded_by | Unknown |  |
| recorded_by_email | Unknown |  |
| transaction_id | Unknown |  |

### invoice_line_item

| Column | Type | Keys |
| --- | --- | --- |
| id | Unknown | PK |
| invoice_id | Unknown | FK |
| project_id | Unknown | FK |
| amount | Unknown |  |
| description | Unknown |  |
| kind | Unknown |  |
| quantity | Unknown |  |
| taxed | Unknown |  |
| taxed_2 | Unknown |  |
| unit_price | Unknown |  |

### invoice

| Column | Type | Keys |
| --- | --- | --- |
| id | Unknown | PK |
| updated_at | Unknown | PK |
| client_id | Unknown | FK |
| creator_id | Unknown | FK |
| amount | Unknown |  |
| client_key | Unknown |  |
| closed_at | Unknown |  |
| created_at | Unknown |  |
| currency | Unknown |  |
| discount | Unknown |  |
| discount_amount | Unknown |  |
| due_amount | Unknown |  |
| due_date | Unknown |  |
| issue_date | Unknown |  |
| notes | Unknown |  |
| number | Unknown |  |
| paid_at | Unknown |  |
| paid_date | Unknown |  |
| payment_term | Unknown |  |
| period_end | Unknown |  |
| period_start | Unknown |  |
| purchase_order | Unknown |  |
| recurring_invoice_id | Unknown |  |
| sent_at | Unknown |  |
| state | Unknown |  |
| subject | Unknown |  |
| tax | Unknown |  |
| tax_2 | Unknown |  |
| tax_2_amount | Unknown |  |
| tax_amount | Unknown |  |

### client

| Column | Type | Keys |
| --- | --- | --- |
| id | Unknown | PK |
| updated_at | Unknown | PK |
| address | Unknown |  |
| created_at | Unknown |  |
| currency | Unknown |  |
| is_active | Unknown |  |
| name | Unknown |  |
| statement_key | Unknown |  |

### expense

| Column | Type | Keys |
| --- | --- | --- |
| id | Unknown | PK |
| updated_at | Unknown | PK |
| client_id | Unknown | FK |
| expense_category_id | Unknown | FK |
| invoice_id | Unknown | FK |
| project_id | Unknown | FK |
| user_assignment_id | Unknown | FK |
| user_id | Unknown | FK |
| billable | Unknown |  |
| created_at | Unknown |  |
| is_billed | Unknown |  |
| is_closed | Unknown |  |
| is_locked | Unknown |  |
| locked_reason | Unknown |  |
| notes | Unknown |  |
| receipt_content_type | Unknown |  |
| receipt_file_name | Unknown |  |
| receipt_file_size | Unknown |  |
| receipt_url | Unknown |  |
| spent_date | Unknown |  |
| total_cost | Unknown |  |
| units | Unknown |  |

### user_billable_rate

| Column | Type | Keys |
| --- | --- | --- |
| id | Unknown | PK |
| updated_at | Unknown | PK |
| users_id | Unknown | FK |
| amount | Unknown |  |
| created_at | Unknown |  |
| end_date | Unknown |  |
| start_date | Unknown |  |

### estimate_message_recipient

| Column | Type | Keys |
| --- | --- | --- |
| email | Unknown | PK |
| estimate_message_id | Unknown | PK, FK |
| name | Unknown |  |

### estimate_message

| Column | Type | Keys |
| --- | --- | --- |
| id | Unknown | PK |
| updated_at | Unknown | PK |
| estimate_id | Unknown | FK |
| body | Unknown |  |
| created_at | Unknown |  |
| event_type | Unknown |  |
| send_me_a_copy | Unknown |  |
| sent_by | Unknown |  |
| sent_by_email | Unknown |  |
| sent_from | Unknown |  |
| sent_from_email | Unknown |  |
| subject | Unknown |  |

### users_permission_claim

| Column | Type | Keys |
| --- | --- | --- |
| permission_claim_name | Unknown | PK |
| users_id | Unknown | PK, FK |

### users

| Column | Type | Keys |
| --- | --- | --- |
| id | Unknown | PK |
| updated_at | Unknown | PK |
| avatar_url | Unknown |  |
| calendar_integration_enabled | Unknown |  |
| calendar_integration_source | Unknown |  |
| can_close_account | Unknown |  |
| can_create_invoices | Unknown |  |
| can_create_projects | Unknown |  |
| can_see_rates | Unknown |  |
| cost_rate | Unknown |  |
| created_at | Unknown |  |
| default_hourly_rate | Unknown |  |
| email | Unknown |  |
| first_name | Unknown |  |
| has_access_to_all_future_projects | Unknown |  |
| is_active | Unknown |  |
| is_admin | Unknown |  |
| is_contractor | Unknown |  |
| is_project_manager | Unknown |  |
| last_name | Unknown |  |
| telephone | Unknown |  |
| timezone | Unknown |  |
| weekly_capacity | Unknown |  |

### estimate_line_item

| Column | Type | Keys |
| --- | --- | --- |
| id | Unknown | PK |
| estimate_id | Unknown | FK |
| amount | Unknown |  |
| description | Unknown |  |
| kind | Unknown |  |
| quantity | Unknown |  |
| taxed | Unknown |  |
| taxed_2 | Unknown |  |
| unit_price | Unknown |  |

### estimate

| Column | Type | Keys |
| --- | --- | --- |
| id | Unknown | PK |
| updated_at | Unknown | PK |
| client_id | Unknown | FK |
| creator_id | Unknown | FK |
| accepted_at | Unknown |  |
| amount | Unknown |  |
| client_key | Unknown |  |
| created_at | Unknown |  |
| currency | Unknown |  |
| declined_at | Unknown |  |
| discount | Unknown |  |
| discount_amount | Unknown |  |
| issue_date | Unknown |  |
| notes | Unknown |  |
| number | Unknown |  |
| purchase_order | Unknown |  |
| sent_at | Unknown |  |
| state | Unknown |  |
| subject | Unknown |  |
| tax | Unknown |  |
| tax_2 | Unknown |  |
| tax_2_amount | Unknown |  |
| tax_amount | Unknown |  |

## Relationships

- contact(client_id) → client(id)
- project_user_assignment(user_id) → users(id)
- project_user_assignment(project_id) → project(id)
- role_user(role_id) → role(id)
- time_entry(user_id) → users(id)
- time_entry(task_id) → task(id)
- time_entry(task_assignment_id) → project_task_assignment(id)
- time_entry(user_assignment_id) → project_user_assignment(id)
- time_entry(invoice_id) → invoice(id)
- time_entry(project_id) → project(id)
- time_entry(client_id) → client(id)
- project_task_assignment(task_id) → task(id)
- project_task_assignment(project_id) → project(id)
- invoice_message_recipient(invoice_message_id) → invoice_message(id)
- invoice_message(invoice_id) → invoice(id)
- user_cost_rate(users_id) → users(id)
- user_project_assignment_task_assignment(task_id) → task(id)
- user_project_assignment_task_assignment(users_id) → users(id)
- user_project_assignment(project_id) → project(id)
- user_project_assignment(client_id) → client(id)
- user_project_assignment(users_id) → users(id)
- project(client_id) → client(id)
- invoice_payment(invoice_id) → invoice(id)
- invoice_line_item(project_id) → project(id)
- invoice_line_item(invoice_id) → invoice(id)
- invoice(creator_id) → users(id)
- invoice(client_id) → client(id)
- expense(user_id) → users(id)
- expense(user_assignment_id) → project_user_assignment(id)
- expense(invoice_id) → invoice(id)
- expense(project_id) → project(id)
- expense(expense_category_id) → expense_category(id)
- expense(client_id) → client(id)
- user_billable_rate(users_id) → users(id)
- estimate_message_recipient(estimate_message_id) → estimate_message(id)
- estimate_message(estimate_id) → estimate(id)
- users_permission_claim(users_id) → users(id)
- estimate_line_item(estimate_id) → estimate(id)
- estimate(creator_id) → users(id)
- estimate(client_id) → client(id)
