# Drift schema ERD

Table and field reference for the Fivetran Drift connector.

## Table & Field Reference

### contact_tag

| Column | Type | Keys |
| --- | --- | --- |
| name | String | PK |
| contact_id | Long | PK, FK |
| color | String |  |

### contact

| Column | Type | Keys |
| --- | --- | --- |
| id | Long | PK |
| created_at | Instant |  |
| email | String |  |
| events | Json |  |
| name | String |  |
| phone | String |  |
| social_profiles | Json |  |
| custom_** |  |  |

### message_button

| Column | Type | Keys |
| --- | --- | --- |
| label | String | PK |
| conversation_id | Long | PK, FK |
| conversation_message_id | Long | PK, FK |
| reaction_message | String |  |
| reaction_type | String |  |
| style | String |  |
| type | String |  |
| value | String |  |

### conversation_message

| Column | Type | Keys |
| --- | --- | --- |
| id | Long | PK |
| conversation_id | Long | PK, FK |
| author_id | Long |  |
| author_type | String |  |
| body | String |  |
| city | String |  |
| country | String |  |
| country_name | String |  |
| created_at | Instant |  |
| developer_app_id | String |  |
| href | String |  |
| ip | String |  |
| is_author_bot | Boolean |  |
| latitude | Double |  |
| locale | String |  |
| longitude | Double |  |
| org_id | Long |  |
| postal_code | String |  |
| pre_messages | Json |  |
| referrer | String |  |
| region | String |  |
| timezone | String |  |
| title | String |  |
| type | String |  |
| user_agent | String |  |

### playbook_clp

| Column | Type | Keys |
| --- | --- | --- |
| playbook_id | Long | PK, FK |
| landing_page_url | String |  |
| playbook_name | String |  |

### account_custom_property

| Column | Type | Keys |
| --- | --- | --- |
| name | String | PK |
| account_id | String | PK, FK |
| label | String |  |
| type | String |  |
| value | Json |  |

### account

| Column | Type | Keys |
| --- | --- | --- |
| id | String | PK |
| owner_id | Long | FK |
| create_date_time | Instant |  |
| deleted | Boolean |  |
| domain | String |  |
| name | String |  |
| targeted | Boolean |  |
| update_date_time | Instant |  |

### playbook_goal

| Column | Type | Keys |
| --- | --- | --- |
| id | String | PK |
| playbook_id | Long | PK, FK |
| message | String |  |
| name | String |  |

### playbook

| Column | Type | Keys |
| --- | --- | --- |
| id | Long | PK |
| created_author_id | Long | FK |
| updated_author_id | Long | FK |
| created_at | Instant |  |
| interaction_id | Long |  |
| meta | Json |  |
| name | String |  |
| org_id | Long |  |
| report_type | String |  |
| updated_at | Instant |  |

### users

| Column | Type | Keys |
| --- | --- | --- |
| id | Long | PK |
| alias | String |  |
| availability | String |  |
| avatar_url | String |  |
| bot | Boolean |  |
| created_at | Unknown |  |
| email | String |  |
| locale | String |  |
| name | String |  |
| org_id | Long |  |
| phone | String |  |
| role | String |  |
| time_zone | String |  |
| updated_at | Unknown |  |
| verified | Boolean |  |

### conversation_participant

| Column | Type | Keys |
| --- | --- | --- |
| conversation_id | Long | PK, FK |
| user_id | Long | PK, FK |

### conversation_tag

| Column | Type | Keys |
| --- | --- | --- |
| name | String | PK |
| conversation_id | Long | PK, FK |
| color | String |  |

### conversation

| Column | Type | Keys |
| --- | --- | --- |
| id | Long | PK |
| contact_id | Long | FK |
| created_at | Instant |  |
| inbox_id | Long |  |
| related_playbook_id | Long |  |
| status | String |  |
| updated_at | Instant |  |

## Relationships

- contact_tag(contact_id) → contact(id)
- message_button(conversation_message_id) → conversation_message(id)
- message_button(conversation_id) → conversation_message(conversation_id)
- conversation_message(conversation_id) → conversation(id)
- playbook_clp(playbook_id) → playbook(id)
- account_custom_property(account_id) → account(id)
- account(owner_id) → users(id)
- playbook_goal(playbook_id) → playbook(id)
- playbook(updated_author_id) → users(id)
- playbook(created_author_id) → users(id)
- conversation_participant(user_id) → users(id)
- conversation_participant(conversation_id) → conversation(id)
- conversation_tag(conversation_id) → conversation(id)
- conversation(contact_id) → contact(id)
