# Slack schema ERD

Table and field reference for the Fivetran Slack connector.

## Table & Field Reference

### user_group_user

| Column | Type | Keys |
| --- | --- | --- |
| user_group_id | String | PK, FK |
| user_id | String | PK, FK |

### user_group_prefs_channel

| Column | Type | Keys |
| --- | --- | --- |
| public_channel_id | String | PK |
| user_group_id | String | PK, FK |

### user_group_prefs_group

| Column | Type | Keys |
| --- | --- | --- |
| private_channel_id | String | PK |
| user_group_id | String | PK, FK |

### user_group

| Column | Type | Keys |
| --- | --- | --- |
| id | String | PK |
| created_by | String | FK |
| deleted_by | String | FK |
| updated_by | String | FK |
| auto_type | String |  |
| date_create | Instant |  |
| date_delete | Instant |  |
| date_update | Instant |  |
| description | String |  |
| handle | String |  |
| is_external | Boolean |  |
| is_user_group | Boolean |  |
| name | String |  |
| team_id | String |  |
| user_count | Unknown |  |

### channel_member

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

### team_preference

| Column | Type | Keys |
| --- | --- | --- |
| _fivetran_id | String | PK |
| allow_message_deletion | Boolean |  |
| disable_file_uploads | String |  |
| display_real_names | Boolean |  |
| msg_edit_window_mins | Unknown |  |
| who_can_post_general | String |  |

### dnd_info

| Column | Type | Keys |
| --- | --- | --- |
| _fivetran_id | String | PK |
| user_id | String | FK |
| dnd_enabled | Boolean |  |
| next_dnd_end_ts | Instant |  |
| next_dnd_start_ts | Instant |  |
| snooze_enabled | Boolean |  |
| snooze_endtime | Instant |  |
| snooze_is_indefinite | Boolean |  |
| snooze_remaining | Unknown |  |

### remote_file_channel

| Column | Type | Keys |
| --- | --- | --- |
| remote_file_channel | String | PK |
| remote_file_id | String | PK, FK |

### remote_file

| Column | Type | Keys |
| --- | --- | --- |
| id | String | PK |
| channel_id | String | PK, FK |
| user_id | String | FK |
| created | Instant |  |
| deanimate_gif | String |  |
| display_as_bot | Boolean |  |
| editable | Boolean |  |
| external_type | String |  |
| filetype | String |  |
| image_exif_rotation | String |  |
| is_external | Boolean |  |
| is_public | Boolean |  |
| mimetype | String |  |
| mode | String |  |
| name | String |  |
| original_h | String |  |
| original_w | String |  |
| permalink | String |  |
| permalink_public | String |  |
| pjpeg | String |  |
| pretty_type | String |  |
| public_url_shared | Boolean |  |
| size | Unknown |  |
| thumb_160 | String |  |
| thumb_360 | String |  |
| thumb_360_gif | String |  |
| thumb_360_h | String |  |
| thumb_360_w | String |  |
| thumb_64 | String |  |
| thumb_80 | String |  |
| timestamps | Instant |  |
| title | String |  |
| url_private | String |  |
| url_private_download | String |  |
| username | String |  |

### message_reply_user

| Column | Type | Keys |
| --- | --- | --- |
| message_channel_id | String | PK, FK |
| message_ts | String | PK, FK |
| parent_message_ts | String | PK, FK |
| reply_user_id | String | PK, FK |

### message_block_element

| Column | Type | Keys |
| --- | --- | --- |
| index | Unknown | PK |
| message_channel_id | String | PK, FK |
| message_ts | String | PK, FK |
| parent_message_ts | String | PK, FK |
| message_block_index | Unknown | FK |
| elements | String |  |
| type | String |  |

### message_block

| Column | Type | Keys |
| --- | --- | --- |
| index | Unknown | PK |
| message_channel_id | String | PK, FK |
| message_ts | String | PK, FK |
| parent_message_ts | String | PK, FK |
| block_id | String |  |
| type | String |  |

### message_file

| Column | Type | Keys |
| --- | --- | --- |
| id | String | PK |
| message_channel_id | String | FK |
| message_ts | String | FK |
| parent_message_ts | String | FK |
| user_id | String | FK |
| created | Instant |  |
| display_as_bot | Boolean |  |
| edit_link | String |  |
| editable | Boolean |  |
| external_type | String |  |
| filetype | String |  |
| has_rich_preview | Boolean |  |
| is_external | Boolean |  |
| is_public | Boolean |  |
| is_starred | Boolean |  |
| lines | Unknown |  |
| lines_more | Unknown |  |
| mimetype | String |  |
| mode | String |  |
| name | String |  |
| permalink | String |  |
| permalink_public | String |  |
| pretty_type | String |  |
| preview | String |  |
| preview_highlight | String |  |
| preview_is_truncated | Boolean |  |
| public_url_shared | Boolean |  |
| size | Unknown |  |
| timestamps | Instant |  |
| title | String |  |
| url_private | String |  |
| url_private_download | String |  |

### message_attachment

| Column | Type | Keys |
| --- | --- | --- |
| _fivetran_id | String | PK |
| message_channel_id | String | FK |
| message_ts | String | FK |
| parent_message_ts | String | FK |
| fallback | String |  |
| from_url | String |  |
| id | Unknown |  |
| image_bytes | Unknown |  |
| image_height | String |  |
| image_url | String |  |
| image_width | String |  |
| original_url | String |  |
| service_name | String |  |
| text | String |  |
| title | String |  |
| title_link | String |  |

### message_reaction_user

| Column | Type | Keys |
| --- | --- | --- |
| message_channel_id | String | PK, FK |
| message_reaction_name | String | PK, FK |
| message_ts | String | PK, FK |
| parent_message_ts | String | PK, FK |
| user_id | String | PK, FK |

### message_reaction

| Column | Type | Keys |
| --- | --- | --- |
| name | String | PK |
| message_channel_id | String | PK, FK |
| message_ts | String | PK, FK |
| parent_message_ts | String | PK, FK |
| count | String |  |

### message

| Column | Type | Keys |
| --- | --- | --- |
| ts | String | PK |
| message_channel_id | String | PK, FK |
| parent_message_ts | String | PK, FK |
| user_id | String | FK |
| edited_ts | Unknown |  |
| edited_user | String |  |
| is_locked | String |  |
| last_read | String |  |
| latest_reply | Unknown |  |
| reply_count | Unknown |  |
| reply_users_count | Unknown |  |
| source_team | String |  |
| subscribed | String |  |
| subtype | String |  |
| team | String |  |
| text | String |  |
| thread_ts | Unknown |  |
| type | String |  |

### bookmark

| Column | Type | Keys |
| --- | --- | --- |
| id | String | PK |
| channel_id | String | FK |
| last_updated_by_user_id | String | FK |
| app_id | String |  |
| date_created | Instant |  |
| date_updated | Instant |  |
| emoji | String |  |
| entity_id | String |  |
| icon_url | String |  |
| last_updated_by_team_id | String |  |
| link | String |  |
| rank | String |  |
| shortcut_id | String |  |
| title | String |  |
| type | String |  |

### scheduled_message

| Column | Type | Keys |
| --- | --- | --- |
| id | String | PK |
| channel_id | String | FK |
| date_created | Instant |  |
| post_at | Instant |  |
| text | String |  |

### chat_permalink

| Column | Type | Keys |
| --- | --- | --- |
| permalink | String | PK |
| channel_id | String | PK, FK |
| message_ts | String | PK, FK |

### profile_field_possible_value

| Column | Type | Keys |
| --- | --- | --- |
| possible_value | String | PK |
| profile_field_id | String | PK, FK |

### profile_field_option

| Column | Type | Keys |
| --- | --- | --- |
| name | Unknown | PK |
| profile_field_id | String | PK, FK |
| value | Unknown |  |

### profile_field

| Column | Type | Keys |
| --- | --- | --- |
| id | String | PK |
| hint | String |  |
| is_hidden | Unknown |  |
| label | String |  |
| options_is_protected | Unknown |  |
| ordering | Unknown |  |
| type | String |  |

### pin

| Column | Type | Keys |
| --- | --- | --- |
| channel_id | String | PK, FK |
| message_ts | String | PK, FK |
| created_by | String | FK |
| pinned_time | String |  |

### channel_pending_shared

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

### channel_shared_team

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

### channel_internal_team

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

### channel_pending_connected_team

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

### previous_channel_name

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

### channel

| Column | Type | Keys |
| --- | --- | --- |
| id | String | PK |
| creator | String | FK |
| created | Instant |  |
| is_archived | Boolean |  |
| is_channel | Boolean |  |
| is_ext_shared | Boolean |  |
| is_general | Boolean |  |
| is_group | Boolean |  |
| is_im | Boolean |  |
| is_moved | Unknown |  |
| is_mpim | Boolean |  |
| is_org_shared | Boolean |  |
| is_pending_ext_shared | Boolean |  |
| is_private | Boolean |  |
| is_shared | Boolean |  |
| name | String |  |
| name_normalized | String |  |
| parent_conversation | Boolean |  |
| purpose_creator | String |  |
| purpose_last_set | Instant |  |
| purpose_value | String |  |
| topic_creator | String |  |
| topic_last_set | Instant |  |
| topic_value | String |  |
| unlinked | Unknown |  |

### team_billing

| Column | Type | Keys |
| --- | --- | --- |
| plan | String | PK |

### users

| Column | Type | Keys |
| --- | --- | --- |
| id | String | PK |
| always_active | Unknown |  |
| app_api_id | Unknown |  |
| avatar_hash | String |  |
| bot_id | Unknown |  |
| color | String |  |
| deleted | Boolean |  |
| display_name | String |  |
| display_name_normalized | String |  |
| email | Unknown |  |
| first_name | String |  |
| image_192 | String |  |
| image_24 | String |  |
| image_32 | String |  |
| image_48 | String |  |
| image_512 | String |  |
| image_72 | String |  |
| is_admin | Boolean |  |
| is_app_user | Boolean |  |
| is_bot | Boolean |  |
| is_email_confirmed | Boolean |  |
| is_owner | Boolean |  |
| is_primary_owner | Boolean |  |
| is_restricted | Boolean |  |
| is_ultra_restricted | Boolean |  |
| last_name | String |  |
| locale | String |  |
| name | String |  |
| phone | String |  |
| real_name | String |  |
| real_name_normalized | String |  |
| skype | String |  |
| start_date | Unknown |  |
| status_emoji | String |  |
| status_emoji_display_info | Json |  |
| status_expiration | Unknown |  |
| status_text | String |  |
| status_text_canonical | String |  |
| team | Unknown |  |
| team_id | String |  |
| time_zone | String |  |
| time_zone_label | String |  |
| time_zone_offset | String |  |
| title | String |  |
| updated | Unknown |  |
| who_can_share_contact_card | String |  |

## Relationships

- user_group_user(user_id) → users(id)
- user_group_user(user_group_id) → user_group(id)
- user_group_prefs_channel(user_group_id) → user_group(id)
- user_group_prefs_group(user_group_id) → user_group(id)
- user_group(deleted_by) → users(id)
- user_group(created_by) → users(id)
- user_group(updated_by) → users(id)
- channel_member(user_id) → users(id)
- channel_member(channel_id) → channel(id)
- dnd_info(user_id) → users(id)
- remote_file_channel(remote_file_id) → remote_file(id)
- remote_file(user_id) → users(id)
- remote_file(channel_id) → channel(id)
- message_reply_user(reply_user_id) → users(id)
- message_reply_user(message_ts) → message(ts)
- message_reply_user(parent_message_ts) → message(parent_message_ts)
- message_reply_user(message_channel_id) → message(message_channel_id)
- message_block_element(message_ts) → message_block(message_ts)
- message_block_element(parent_message_ts) → message_block(parent_message_ts)
- message_block_element(message_channel_id) → message_block(message_channel_id)
- message_block_element(message_block_index) → message_block(index)
- message_block(message_ts) → message(ts)
- message_block(parent_message_ts) → message(parent_message_ts)
- message_block(message_channel_id) → message(message_channel_id)
- message_file(user_id) → users(id)
- message_file(message_ts) → message(ts)
- message_file(parent_message_ts) → message(parent_message_ts)
- message_file(message_channel_id) → message(message_channel_id)
- message_attachment(message_ts) → message(ts)
- message_attachment(parent_message_ts) → message(parent_message_ts)
- message_attachment(message_channel_id) → message(message_channel_id)
- message_reaction_user(user_id) → users(id)
- message_reaction_user(message_ts) → message_reaction(message_ts)
- message_reaction_user(parent_message_ts) → message_reaction(parent_message_ts)
- message_reaction_user(message_channel_id) → message_reaction(message_channel_id)
- message_reaction_user(message_reaction_name) → message_reaction(name)
- message_reaction(message_ts) → message(ts)
- message_reaction(parent_message_ts) → message(parent_message_ts)
- message_reaction(message_channel_id) → message(message_channel_id)
- message(user_id) → users(id)
- message(parent_message_ts) → message(ts)
- message(message_channel_id) → channel(id)
- bookmark(channel_id) → channel(id)
- bookmark(last_updated_by_user_id) → users(id)
- scheduled_message(channel_id) → channel(id)
- chat_permalink(message_ts) → message(ts)
- chat_permalink(channel_id) → channel(id)
- profile_field_possible_value(profile_field_id) → profile_field(id)
- profile_field_option(profile_field_id) → profile_field(id)
- pin(channel_id) → channel(id)
- pin(message_ts) → message(ts)
- pin(created_by) → users(id)
- channel_pending_shared(channel_id) → channel(id)
- channel_shared_team(channel_id) → channel(id)
- channel_internal_team(channel_id) → channel(id)
- channel_pending_connected_team(channel_id) → channel(id)
- previous_channel_name(channel_id) → channel(id)
- channel(creator) → users(id)
