# Front schema ERD

Table and field reference for the Fivetran Front connector.

## Table & Field Reference

### conversation

| Column | Type | Keys |
| --- | --- | --- |
| id | String | PK |
| last_message_id | String | FK |
| teammate_id | String | FK |
| created_at | Instant |  |
| recipient_handle | String |  |
| recipient_role | String |  |
| status | String |  |
| status_category | String |  |
| status_id | String |  |
| subject | String |  |

### inbox_channel

| Column | Type | Keys |
| --- | --- | --- |
| channel_id | String | PK, FK |
| inbox_id | String | PK, FK |

### inbox

| Column | Type | Keys |
| --- | --- | --- |
| id | String | PK |
| address | String |  |
| name | String |  |
| send_as | String |  |
| type | String |  |

### rule_action

| Column | Type | Keys |
| --- | --- | --- |
| index | Int | PK |
| rule_id | String | PK, FK |
| action | String |  |

### conversation_link_history

| Column | Type | Keys |
| --- | --- | --- |
| link_id | String | PK |
| updated_at | Instant | PK |
| conversation_id | String | PK, FK |
| source_rule_id | String | FK |
| source_teammate_id | String | FK |
| event_type | String |  |
| source_type | String |  |

### list

| Column | Type | Keys |
| --- | --- | --- |
| id | String | PK |
| name | String |  |

### comment

| Column | Type | Keys |
| --- | --- | --- |
| id | String | PK |
| conversation_id | String | FK |
| author_id | String |  |
| body | String |  |
| posted_at | Instant |  |

### team_teammate

| Column | Type | Keys |
| --- | --- | --- |
| team_id | String | PK, FK |
| teammate_id | String | PK, FK |

### shift_teammate

| Column | Type | Keys |
| --- | --- | --- |
| shift_id | String | PK, FK |
| teammate_id | String | PK, FK |

### shift

| Column | Type | Keys |
| --- | --- | --- |
| id | String | PK |
| created_at | Instant |  |
| name | String |  |
| times | Json |  |
| timezone | String |  |
| updated_at | Instant |  |

### conversation_tag_history

| Column | Type | Keys |
| --- | --- | --- |
| tag_id | String | PK |
| updated_at | Instant | PK |
| conversation_id | String | PK, FK |
| source_rule_id | String | FK |
| source_teammate_id | String | FK |
| event_type | String |  |
| source_type | String |  |

### conversation_link

| Column | Type | Keys |
| --- | --- | --- |
| conversation_id | String | PK, FK |
| link_id | String | PK, FK |

### tag

| Column | Type | Keys |
| --- | --- | --- |
| id | String | PK |
| created_at | Instant |  |
| description | String |  |
| highlight | String |  |
| is_private | Boolean |  |
| is_visible_in_conversation_lists | Boolean |  |
| name | String |  |
| parent_tag_id | String |  |
| updated_at | Instant |  |

### ticket_status

| Column | Type | Keys |
| --- | --- | --- |
| id | String | PK |
| category | String |  |
| created_at | Instant |  |
| description | String |  |
| name | String |  |
| updated_at | Instant |  |

### comment_mention

| Column | Type | Keys |
| --- | --- | --- |
| teammate_id | String | PK |
| comment_id | String | PK, FK |

### message_recipient

| Column | Type | Keys |
| --- | --- | --- |
| index | Int | PK |
| message_id | String | PK, FK |
| contact_id | String | FK |
| handle | String |  |
| role | String |  |

### conversation_inbox

| Column | Type | Keys |
| --- | --- | --- |
| conversation_id | String | PK, FK |
| inbox_id | String | PK, FK |

### message_template_inbox

| Column | Type | Keys |
| --- | --- | --- |
| inbox_id | String | PK, FK |
| message_template_id | String | PK, FK |

### inbox_teammate

| Column | Type | Keys |
| --- | --- | --- |
| inbox_id | String | PK, FK |
| teammate_id | String | PK, FK |

### message_template_folder

| Column | Type | Keys |
| --- | --- | --- |
| id | String | PK |
| owner_id | String | FK |
| parent_folder_id | String | FK |
| created_at | Instant |  |
| name | String |  |
| updated_at | Instant |  |

### account

| Column | Type | Keys |
| --- | --- | --- |
| id | String | PK |
| created_at | Instant |  |
| description | String |  |
| domains | Json |  |
| external_id | String |  |
| logo_url | String |  |
| name | String |  |
| updated_at | Instant |  |

### message

| Column | Type | Keys |
| --- | --- | --- |
| id | String | PK |
| author_id | String | FK |
| conversation_id | String | FK |
| blurb | String |  |
| body | String |  |
| created_at | Instant |  |
| duration | Int |  |
| have_been_answered | Boolean |  |
| have_been_favorited | Boolean |  |
| have_been_retweeted | Boolean |  |
| headers | Json |  |
| intercom_url | String |  |
| is_inbound | Boolean |  |
| is_retweet | Boolean |  |
| text | String |  |
| thread_ref | String |  |
| twitter_url | String |  |
| type | String |  |

### teammate

| Column | Type | Keys |
| --- | --- | --- |
| id | String | PK |
| email | String |  |
| first_name | String |  |
| is_admin | Boolean |  |
| is_available | Boolean |  |
| last_name | String |  |
| username | String |  |

### contact_link

| Column | Type | Keys |
| --- | --- | --- |
| index | Int | PK |
| contact_id | String | PK, FK |
| link | String |  |

### follower

| Column | Type | Keys |
| --- | --- | --- |
| conversation_id | String | PK, FK |
| teammate_id | String | PK, FK |

### conversation_status_history

| Column | Type | Keys |
| --- | --- | --- |
| status | String | PK |
| updated_at | Instant | PK |
| conversation_id | String | PK, FK |
| source_rule_id | String | FK |
| source_teammate_id | String | FK |
| target_teammate_id | String | FK |
| source_type | String |  |

### link

| Column | Type | Keys |
| --- | --- | --- |
| id | String | PK |
| external_url | String |  |
| name | String |  |
| type | String |  |

### team_inbox

| Column | Type | Keys |
| --- | --- | --- |
| inbox_id | String | PK, FK |
| team_id | String | PK, FK |

### channel

| Column | Type | Keys |
| --- | --- | --- |
| id | String | PK |
| address | String |  |
| send_as | String |  |
| settings | Json |  |
| type | String |  |

### team

| Column | Type | Keys |
| --- | --- | --- |
| id | String | PK |
| name | String |  |

### message_template

| Column | Type | Keys |
| --- | --- | --- |
| id | String | PK |
| folder_id | String | FK |
| owner_id | String | FK |
| body | String |  |
| is_available_for_all_inboxes | Boolean |  |
| name | String |  |
| subject | String |  |

### attachment

| Column | Type | Keys |
| --- | --- | --- |
| index | Int | PK |
| message_id | String | PK, FK |
| cid | String |  |
| content_type | String |  |
| filename | String |  |
| is_inline | Boolean |  |
| size | Int |  |
| url | String |  |

### contact

| Column | Type | Keys |
| --- | --- | --- |
| id | String | PK |
| account_id | String | FK |
| avatar_url | String |  |
| description | String |  |
| name | String |  |

### conversation_tag

| Column | Type | Keys |
| --- | --- | --- |
| conversation_id | String | PK, FK |
| tag_id | String | PK, FK |

### contact_handle

| Column | Type | Keys |
| --- | --- | --- |
| index | Int | PK |
| contact_id | String | PK, FK |
| handle | String |  |
| source | String |  |

### contact_note

| Column | Type | Keys |
| --- | --- | --- |
| index | Int | PK |
| contact_id | String | PK, FK |
| author_id | String | FK |
| body | String |  |
| created_at | Instant |  |

### contact_list

| Column | Type | Keys |
| --- | --- | --- |
| contact_id | String | PK, FK |
| list_id | String | PK, FK |

### message_template_attachment

| Column | Type | Keys |
| --- | --- | --- |
| id | String | PK |
| message_template_id | String | PK, FK |
| cid | String |  |
| content_type | String |  |
| filename | String |  |
| is_inline | Boolean |  |
| size | Int |  |
| url | String |  |

### rule

| Column | Type | Keys |
| --- | --- | --- |
| id | String | PK |
| name | String |  |

## Relationships

- conversation(teammate_id) → teammate(id)
- conversation(last_message_id) → message(id)
- inbox_channel(inbox_id) → inbox(id)
- inbox_channel(channel_id) → channel(id)
- rule_action(rule_id) → rule(id)
- conversation_link_history(conversation_id) → conversation(id)
- conversation_link_history(source_teammate_id) → teammate(id)
- conversation_link_history(source_rule_id) → rule(id)
- comment(conversation_id) → conversation(id)
- team_teammate(team_id) → team(id)
- team_teammate(teammate_id) → teammate(id)
- shift_teammate(shift_id) → shift(id)
- shift_teammate(teammate_id) → teammate(id)
- conversation_tag_history(conversation_id) → conversation(id)
- conversation_tag_history(source_teammate_id) → teammate(id)
- conversation_tag_history(source_rule_id) → rule(id)
- conversation_link(conversation_id) → conversation(id)
- conversation_link(link_id) → link(id)
- comment_mention(comment_id) → comment(id)
- message_recipient(message_id) → message(id)
- message_recipient(contact_id) → contact(id)
- conversation_inbox(conversation_id) → conversation(id)
- conversation_inbox(inbox_id) → inbox(id)
- message_template_inbox(message_template_id) → message_template(id)
- message_template_inbox(inbox_id) → inbox(id)
- inbox_teammate(inbox_id) → inbox(id)
- inbox_teammate(teammate_id) → teammate(id)
- message_template_folder(parent_folder_id) → message_template_folder(id)
- message_template_folder(owner_id) → team(id)
- message(conversation_id) → conversation(id)
- message(author_id) → teammate(id)
- contact_link(contact_id) → contact(id)
- follower(conversation_id) → conversation(id)
- follower(teammate_id) → teammate(id)
- conversation_status_history(conversation_id) → conversation(id)
- conversation_status_history(target_teammate_id) → teammate(id)
- conversation_status_history(source_teammate_id) → teammate(id)
- conversation_status_history(source_rule_id) → rule(id)
- team_inbox(team_id) → team(id)
- team_inbox(inbox_id) → inbox(id)
- message_template(folder_id) → message_template_folder(id)
- message_template(owner_id) → team(id)
- attachment(message_id) → attachment(message_id)
- contact(account_id) → account(id)
- conversation_tag(conversation_id) → conversation(id)
- conversation_tag(tag_id) → tag(id)
- contact_handle(contact_id) → contact(id)
- contact_note(contact_id) → contact(id)
- contact_note(author_id) → teammate(id)
- contact_list(contact_id) → contact(id)
- contact_list(list_id) → list(id)
- message_template_attachment(message_template_id) → message_template(id)
