# Mandrill schema ERD

Table and field reference for the Fivetran Mandrill connector.

## Table & Field Reference

### template_label

| Column | Type | Keys |
| --- | --- | --- |
| label | String | PK |
| template_id | String | PK, FK |

### template

| Column | Type | Keys |
| --- | --- | --- |
| id | String | PK |
| code | String |  |
| created_at | LocalDateTime |  |
| draft_updated_at | LocalDateTime |  |
| from_email | String |  |
| from_name | String |  |
| name | String |  |
| publish_code | String |  |
| publish_from_email | String |  |
| publish_from_name | String |  |
| publish_name | String |  |
| publish_subject | String |  |
| publish_text | String |  |
| published_at | LocalDateTime |  |
| subject | String |  |
| text | String |  |
| updated_at | LocalDateTime |  |

### message_smtp_event

| Column | Type | Keys |
| --- | --- | --- |
| index | Int | PK |
| message_event_fivetran_id | Unknown | PK, FK |
| message_id | String | PK, FK |
| destination_ip | String |  |
| diag | String |  |
| size | Long |  |
| source_ip | String |  |
| timestamps | Instant |  |
| type | String |  |

### message_tag

| Column | Type | Keys |
| --- | --- | --- |
| tags | String | PK |
| message_event_fivetran_id | Unknown | PK, FK |
| message_id | String | PK, FK |

### message

| Column | Type | Keys |
| --- | --- | --- |
| id | String | PK |
| event_fivetran_id | Unknown | PK, FK |
| template_id | String | FK |
| bounce_description | String |  |
| diag | String |  |
| email | String |  |
| metadata | Json |  |
| sender | String |  |
| state | String |  |
| subaccount | String |  |
| subject | String |  |
| timestamps | Instant |  |

### event

| Column | Type | Keys |
| --- | --- | --- |
| _fivetran_id | String | PK |
| message_id | String | FK |
| event | String |  |
| ip | String |  |
| location_city | String |  |
| location_country_long | String |  |
| location_country_short | String |  |
| location_latitude | String |  |
| location_longitude | String |  |
| location_postal_code | String |  |
| location_region | String |  |
| location_timezone | String |  |
| timestamps | Instant |  |
| url | String |  |
| user_agent_company | String |  |
| user_agent_company_url | String |  |
| user_agent_family | String |  |
| user_agent_icon | String |  |
| user_agent_mobile | Boolean |  |
| user_agent_name | String |  |
| user_agent_os_company | String |  |
| user_agent_os_company_url | String |  |
| user_agent_os_family | String |  |
| user_agent_os_icon | String |  |
| user_agent_os_name | String |  |
| user_agent_os_url | String |  |
| user_agent_type | String |  |
| user_agent_url | String |  |
| user_agent_version | String |  |

## Relationships

- template_label(template_id) → template(id)
- message_smtp_event(message_event_fivetran_id) → message(event_fivetran_id)
- message_smtp_event(message_id) → message(id)
- message_tag(message_event_fivetran_id) → message(event_fivetran_id)
- message_tag(message_id) → message(id)
- message(template_id) → template(id)
- message(event_fivetran_id) → event(_fivetran_id)
- event(message_id) → message(id)
