# Notion schema ERD

Table and field reference for the Fivetran Notion connector.

## Table & Field Reference

### block

| Column | Type | Keys |
| --- | --- | --- |
| id | String | PK |
| created_by | String | FK |
| last_edited_by | String | FK |
| page_id | String | FK |
| parent_id | String | FK |
| created_time | Instant |  |
| depth | Int |  |
| has_children | Boolean |  |
| in_trash | Boolean |  |
| last_edited_time | Instant |  |
| ordinal | Int |  |
| parent_type | String |  |
| payload_raw | Json |  |
| plain_text | String |  |
| type | String |  |

### page_comment

| Column | Type | Keys |
| --- | --- | --- |
| id | String | PK |
| created_by | String | FK |
| page_id | String | FK |
| created_time | Instant |  |
| discussion_id | String |  |
| last_edited_time | Instant |  |

### database_data_source

| Column | Type | Keys |
| --- | --- | --- |
| database_id | String | PK, FK |
| id | String | PK, FK |
| name | String |  |

### database_title

| Column | Type | Keys |
| --- | --- | --- |
| index | Unknown | PK |
| database_id | String | PK, FK |
| annotations_bold | Boolean |  |
| annotations_code | Boolean |  |
| annotations_color | String |  |
| annotations_italic | Boolean |  |
| annotations_strikethrough | Boolean |  |
| annotations_underline | Boolean |  |
| equation_expression | String |  |
| href | String |  |
| mention | Json |  |
| plain_text | String |  |
| text_content | String |  |
| text_link_url | String |  |
| type | String |  |

### database

| Column | Type | Keys |
| --- | --- | --- |
| id | String | PK |
| data_source_id | String | PK, FK |
| created_by | String | FK |
| last_edited_by | String | FK |
| parent_block_id | String | FK |
| parent_database_id | String | FK |
| parent_page_id | String | FK |
| cover | Json |  |
| created_time | Instant |  |
| description | Json |  |
| icon | Json |  |
| in_trash | Boolean |  |
| is_inline | Boolean |  |
| is_locked | Boolean |  |
| last_edited_time | Instant |  |
| object | String |  |
| parent_type | String |  |
| public_url | String |  |
| url | String |  |
| workspace | Boolean |  |

### block_comment

| Column | Type | Keys |
| --- | --- | --- |
| id | String | PK |
| block_id | String | PK, FK |
| created_by | String | FK |
| page_id | String | FK |
| created_time | Instant |  |
| discussion_id | String |  |
| last_edited_time | Instant |  |

### users

| Column | Type | Keys |
| --- | --- | --- |
| id | String | PK |
| bot_user_id | String | FK |
| avatar_url | String |  |
| bot_owner_type | String |  |
| bot_workspace_id | String |  |
| email | String |  |
| name | String |  |
| type | String |  |

### data_source_title

| Column | Type | Keys |
| --- | --- | --- |
| index | Unknown | PK |
| data_source_id | String | PK, FK |
| annotations_bold | Boolean |  |
| annotations_code | Boolean |  |
| annotations_color | String |  |
| annotations_italic | Boolean |  |
| annotations_strikethrough | Boolean |  |
| annotations_underline | Boolean |  |
| equation_expression | String |  |
| href | String |  |
| mention | Json |  |
| plain_text | String |  |
| text_content | String |  |
| text_link_url | String |  |
| type | String |  |

### data_source_description

| Column | Type | Keys |
| --- | --- | --- |
| index | Unknown | PK |
| data_source_id | String | PK, FK |
| annotations_bold | Boolean |  |
| annotations_code | Boolean |  |
| annotations_color | String |  |
| annotations_italic | Boolean |  |
| annotations_strikethrough | Boolean |  |
| annotations_underline | Boolean |  |
| equation_expression | String |  |
| href | String |  |
| mention | Json |  |
| plain_text | String |  |
| text_content | String |  |
| text_link_url | String |  |
| type | String |  |

### data_source_property

| Column | Type | Keys |
| --- | --- | --- |
| id | String | PK |
| data_source_id | String | PK, FK |
| description | Json |  |
| name | String |  |
| type | String |  |
| value | Json |  |

### data_source

| Column | Type | Keys |
| --- | --- | --- |
| id | String | PK |
| created_by | String | FK |
| last_edited_by | String | FK |
| parent_block_id | String | FK |
| parent_database_id | String | FK |
| parent_page_id | String | FK |
| cover | Json |  |
| created_time | Instant |  |
| icon | Json |  |
| in_trash | Boolean |  |
| is_archived | Boolean |  |
| is_inline | Boolean |  |
| last_edited_time | Instant |  |
| object | String |  |
| parent_type | String |  |
| public_url | String |  |
| url | String |  |
| workspace | Boolean |  |

### page_property

| Column | Type | Keys |
| --- | --- | --- |
| id | String | PK |
| page_id | String | PK, FK |
| name | String |  |
| type | String |  |
| value | Json |  |

### page

| Column | Type | Keys |
| --- | --- | --- |
| id | String | PK |
| created_by | String | FK |
| last_edited_by | String | FK |
| parent_block_id | String | FK |
| parent_database_id | String | FK |
| parent_page_id | String | FK |
| cover | Unknown |  |
| created_time | Instant |  |
| description | Json |  |
| icon | Unknown |  |
| in_trash | Boolean |  |
| is_archived | Boolean |  |
| is_inline | Boolean |  |
| is_locked | Boolean |  |
| last_edited_time | Instant |  |
| object | Unknown |  |
| parent_type | String |  |
| public_url | String |  |
| url | String |  |
| workspace | String |  |
| custom_** |  |  |

## Relationships

- block(page_id) → page(id)
- block(created_by) → users(id)
- block(last_edited_by) → users(id)
- block(parent_id) → block(id)
- page_comment(page_id) → page(id)
- page_comment(created_by) → users(id)
- database_data_source(id) → data_source(id)
- database_data_source(database_id) → database(id)
- database_title(database_id) → database(id)
- database(created_by) → users(id)
- database(parent_block_id) → block(id)
- database(parent_database_id) → database(id)
- database(last_edited_by) → users(id)
- database(parent_page_id) → page(id)
- database(data_source_id) → data_source(id)
- block_comment(page_id) → page(id)
- block_comment(created_by) → users(id)
- block_comment(block_id) → block(id)
- users(bot_user_id) → users(id)
- data_source_title(data_source_id) → data_source(id)
- data_source_description(data_source_id) → data_source(id)
- data_source_property(data_source_id) → data_source(id)
- data_source(created_by) → users(id)
- data_source(parent_block_id) → block(id)
- data_source(parent_database_id) → data_source(id)
- data_source(last_edited_by) → users(id)
- data_source(parent_page_id) → page(id)
- page_property(page_id) → page(id)
- page(created_by) → users(id)
- page(parent_block_id) → block(id)
- page(parent_database_id) → database(id)
- page(last_edited_by) → users(id)
- page(parent_page_id) → page(id)
