# Facebook Pages schema ERD

Table and field reference for the Fivetran Facebook Pages connector.

## Table & Field Reference

### page_metrics_by_monetization_tool

| Column | Type | Keys |
| --- | --- | --- |
| date | Instant | PK |
| monetization_tool | String | PK |
| page_id | String | PK, FK |
| monetization_approximate_earnings | Double |  |

### reel_metrics_total

| Column | Type | Keys |
| --- | --- | --- |
| date | Instant | PK |
| reel_id | String | PK, FK |
| blue_reels_play_count | Double |  |
| post_video_avg_time_watched | Double |  |
| post_video_followers | Double |  |
| post_video_view_time | Double |  |

### post_metrics_by_video_interval

| Column | Type | Keys |
| --- | --- | --- |
| date | Instant | PK |
| video_interval | Int | PK |
| post_id | String | PK, FK |
| post_video_retention_graph | Double |  |
| post_video_retention_graph_autoplayed | Double |  |
| post_video_retention_graph_clicked_to_play | Double |  |

### post_monetization_metrics

| Column | Type | Keys |
| --- | --- | --- |
| date | Instant | PK |
| post_id | String | PK, FK |
| content_monetization_earnings_currency | String |  |
| content_monetization_earnings_micro_amount | Long |  |
| monetization_approximate_earnings | Double |  |

### page_metrics_by_country

| Column | Type | Keys |
| --- | --- | --- |
| country | String | PK |
| date | Instant | PK |
| page_id | String | PK, FK |
| page_follows_country | Double |  |

### post_video_property_history

| Column | Type | Keys |
| --- | --- | --- |
| index | Int | PK |
| post_id | String | PK, FK |
| updated_time | Instant | PK, FK |
| href | String |  |
| name | String |  |
| text | String |  |

### post_metrics_by_followers

| Column | Type | Keys |
| --- | --- | --- |
| date | Instant | PK |
| is_from_followers | Boolean | PK |
| post_id | String | PK, FK |
| post_media_view | Long |  |

### page_metrics_by_crosspost_status

| Column | Type | Keys |
| --- | --- | --- |
| crosspost_status | String | PK |
| date | Instant | PK |
| page_id | String | PK, FK |
| page_daily_video_ad_break_ad_impressions_by_crosspost_status | Double |  |
| page_daily_video_ad_break_cpm_by_crosspost_status | Double |  |
| page_daily_video_ad_break_earnings_by_crosspost_status | Double |  |

### page_metrics_by_earning_source

| Column | Type | Keys |
| --- | --- | --- |
| date | Instant | PK |
| earning_source | String | PK |
| page_id | String | PK, FK |
| content_monetization_earnings | Double |  |

### page_metrics_by_paid_organic

| Column | Type | Keys |
| --- | --- | --- |
| date | Instant | PK |
| is_from_ads | Boolean | PK |
| page_id | String | PK, FK |
| page_media_view | Long |  |

### post_attachment_history

| Column | Type | Keys |
| --- | --- | --- |
| index | Int | PK |
| post_id | String | PK, FK |
| updated_time | Instant | PK, FK |
| media_image_height | Int |  |
| media_image_src | String |  |
| media_image_width | Int |  |
| media_source | String |  |
| media_type | String |  |
| target_id | String |  |
| target_url | String |  |
| type | String |  |
| unshimmed_url | String |  |
| url | String |  |

### post_metrics_by_paid_organic

| Column | Type | Keys |
| --- | --- | --- |
| date | Instant | PK |
| is_from_ads | Boolean | PK |
| post_id | String | PK, FK |
| post_media_view | Long |  |

### post_metrics_by_action_type

| Column | Type | Keys |
| --- | --- | --- |
| action_type | String | PK |
| date | Instant | PK |
| post_id | String | PK, FK |
| post_activity_by_action_type | Double |  |
| post_activity_by_action_type_unique | Double |  |

### page_metrics_by_city

| Column | Type | Keys |
| --- | --- | --- |
| city | String | PK |
| date | Instant | PK |
| page_id | String | PK, FK |
| page_follows_city | Double |  |

### page_metrics_total

| Column | Type | Keys |
| --- | --- | --- |
| date | Instant | PK |
| page_id | String | PK, FK |
| page_actions_post_reactions_anger_total | Double |  |
| page_actions_post_reactions_haha_total | Double |  |
| page_actions_post_reactions_like_total | Double |  |
| page_actions_post_reactions_love_total | Double |  |
| page_actions_post_reactions_sorry_total | Double |  |
| page_actions_post_reactions_wow_total | Double |  |
| page_daily_follows | Double |  |
| page_daily_follows_unique | Double |  |
| page_daily_unfollows_unique | Double |  |
| page_follows | Double |  |
| page_media_view | Double |  |
| page_post_engagements | Double |  |
| page_total_actions | Double |  |
| page_video_complete_views_30_s | Double |  |
| page_video_complete_views_30_s_autoplayed | Double |  |
| page_video_complete_views_30_s_click_to_play | Double |  |
| page_video_complete_views_30_s_organic | Double |  |
| page_video_complete_views_30_s_paid | Double |  |
| page_video_complete_views_30_s_repeat_views | Double |  |
| page_video_complete_views_30_s_unique | Double |  |
| page_video_repeat_views | Double |  |
| page_video_view_time | Double |  |
| page_video_views | Double |  |
| page_video_views_autoplayed | Double |  |
| page_video_views_click_to_play | Double |  |
| page_video_views_organic | Double |  |
| page_video_views_paid | Double |  |
| page_video_views_unique | Double |  |
| page_views_total | Double |  |

### post_metrics_by_locale

| Column | Type | Keys |
| --- | --- | --- |
| date | Instant | PK |
| locale | String | PK |
| post_id | String | PK, FK |
| post_video_view_time_by_region_id | Double |  |

### page

| Column | Type | Keys |
| --- | --- | --- |
| id | String | PK |
| app_id | String |  |
| birthday | String |  |
| can_checkin | Boolean |  |
| can_post | Boolean |  |
| category | String |  |
| category_list | Json |  |
| checkins | Long |  |
| description | String |  |
| display_subtext | String |  |
| emails | Json |  |
| fan_count | Long |  |
| followers_count | Long |  |
| global_brand_page_name | String |  |
| has_transitioned_to_new_page_experience | Boolean |  |
| hometown | String |  |
| is_always_open | Boolean |  |
| is_community_page | Boolean |  |
| is_eligible_for_branded_content | Boolean |  |
| is_messenger_bot_get_started_enabled | Boolean |  |
| is_messenger_platform_bot | Boolean |  |
| is_owned | Boolean |  |
| is_permanently_closed | Boolean |  |
| is_published | Boolean |  |
| is_unclaimed | Boolean |  |
| name | String |  |
| phone | String |  |
| place_type | String |  |
| price_range | String |  |
| promotion_eligible | Boolean |  |
| promotion_ineligible_reason | String |  |
| single_line_address | String |  |
| talking_about_count | Long |  |
| username | String |  |
| website | String |  |
| were_here_count | Long |  |

### page_video_history

| Column | Type | Keys |
| --- | --- | --- |
| id | String | PK |
| updated_time | Instant | PK |
| page_id | String | FK |
| ad_breaks | Json |  |
| backdated_time | Instant |  |
| backdated_time_granularity | String |  |
| content_category | String |  |
| content_tags | Json |  |
| created_time | Instant |  |
| custom_labels | Json |  |
| description | String |  |
| embed_html | String |  |
| embeddable | Boolean |  |
| event | Json |  |
| format | Json |  |
| from_object | Json |  |
| icon | String |  |
| is_crosspost_video | Boolean |  |
| is_crossposting_eligible | Boolean |  |
| is_episode | Boolean |  |
| is_instagram_eligible | Boolean |  |
| length | Float |  |
| live_status | String |  |
| permalink_url | String |  |
| picture | Json |  |
| place | Json |  |
| post_views | Long |  |
| premiere_living_room_status | String |  |
| privacy | Json |  |
| published | Boolean |  |
| scheduled_publish_time | Instant |  |
| source | String |  |
| title | String |  |
| universal_video_id | String |  |
| views | Long |  |

### post_metrics_by_country

| Column | Type | Keys |
| --- | --- | --- |
| country | String | PK |
| date | Instant | PK |
| post_id | String | PK, FK |
| post_video_view_time_by_country_id | Double |  |

### reel_metrics_by_type

| Column | Type | Keys |
| --- | --- | --- |
| date | Instant | PK |
| type | String | PK |
| reel_id | String | PK, FK |
| post_video_likes_by_reaction_type | Double |  |
| post_video_social_actions | Double |  |

### page_metrics_by_paid_non_paid

| Column | Type | Keys |
| --- | --- | --- |
| date | Instant | PK |
| paid_non_paid | String | PK |
| page_id | String | PK, FK |
| page_fan_adds_by_paid_non_paid_unique | Double |  |
| page_video_views_by_paid_non_paid | Double |  |

### reel_history

| Column | Type | Keys |
| --- | --- | --- |
| id | String | PK |
| updated_time | Instant | PK |
| page_id | String | FK |
| ad_breaks | Json |  |
| backdated_time | Instant |  |
| backdated_time_granularity | String |  |
| content_category | String |  |
| content_tags | Json |  |
| created_time | Instant |  |
| custom_labels | Json |  |
| description | String |  |
| embed_html | String |  |
| embeddable | Boolean |  |
| event | Json |  |
| from_object | Json |  |
| icon | String |  |
| is_crosspost_video | Boolean |  |
| is_episode | Boolean |  |
| is_instagram_eligible | Boolean |  |
| length | Float |  |
| live_status | String |  |
| permalink_url | String |  |
| place | Json |  |
| premiere_living_room_status | String |  |
| published | Boolean |  |
| scheduled_publish_time | Instant |  |
| source | String |  |
| status_processing_progress | Int |  |
| status_value | String |  |
| title | String |  |
| universal_video_id | String |  |
| views | Long |  |

### post_history

| Column | Type | Keys |
| --- | --- | --- |
| id | String | PK |
| updated_time | Instant | PK |
| page_id | String | FK |
| created_time | Instant |  |
| full_picture | String |  |
| is_eligible_for_promotion | Boolean |  |
| is_expired | Boolean |  |
| is_hidden | Boolean |  |
| is_instagram_eligible | Boolean |  |
| is_published | Boolean |  |
| message | String |  |
| parent_id | String |  |
| promotable_id | String |  |
| share_count | Long |  |
| status_type | String |  |
| privacy_** |  |  |

### post_tagged_profile_history

| Column | Type | Keys |
| --- | --- | --- |
| index | Int | PK |
| post_id | String | PK, FK |
| updated_time | Instant | PK, FK |
| id | String |  |
| length | Int |  |
| name | String |  |
| offset | Int |  |
| type | String |  |

### page_video_thumbnail

| Column | Type | Keys |
| --- | --- | --- |
| id | String | PK |
| video_id | String | FK |
| height | Long |  |
| is_preferred | Boolean |  |
| name | String |  |
| scale | Float |  |
| uri | String |  |
| width | Long |  |

### page_monetization_metrics

| Column | Type | Keys |
| --- | --- | --- |
| date | Instant | PK |
| page_id | String | PK, FK |
| content_monetization_earnings_currency | String |  |
| content_monetization_earnings_micro_amount | Long |  |
| monetization_approximate_earnings | Double |  |

### post_metrics_by_type

| Column | Type | Keys |
| --- | --- | --- |
| date | Instant | PK |
| type | String | PK |
| post_id | String | PK, FK |
| post_clicks_by_type | Double |  |
| post_reactions_by_type_total | Double |  |

### post_metrics_by_monetization_tool

| Column | Type | Keys |
| --- | --- | --- |
| date | Instant | PK |
| monetization_tool | String | PK |
| post_id | String | PK, FK |
| monetization_approximate_earnings | Double |  |

### post_metrics_total

| Column | Type | Keys |
| --- | --- | --- |
| date | Instant | PK |
| post_id | String | PK, FK |
| post_clicks | Double |  |
| post_media_view | Double |  |
| post_reactions_anger_total | Double |  |
| post_reactions_haha_total | Double |  |
| post_reactions_like_total | Double |  |
| post_reactions_love_total | Double |  |
| post_reactions_sorry_total | Double |  |
| post_reactions_wow_total | Double |  |
| post_video_ad_break_ad_cpm | Double |  |
| post_video_ad_break_ad_impressions | Double |  |
| post_video_ad_break_earnings | Double |  |
| post_video_avg_time_watched | Double |  |
| post_video_complete_views_30_s_autoplayed | Double |  |
| post_video_complete_views_30_s_clicked_to_play | Double |  |
| post_video_complete_views_30_s_organic | Double |  |
| post_video_complete_views_30_s_paid | Double |  |
| post_video_complete_views_30_s_unique | Double |  |
| post_video_complete_views_organic | Double |  |
| post_video_complete_views_organic_unique | Double |  |
| post_video_complete_views_paid | Double |  |
| post_video_complete_views_paid_unique | Double |  |
| post_video_length | Double |  |
| post_video_view_time | Double |  |
| post_video_view_time_organic | Double |  |
| post_video_views | Double |  |
| post_video_views_15_s | Double |  |
| post_video_views_60_s_excludes_shorter | Double |  |
| post_video_views_autoplayed | Double |  |
| post_video_views_clicked_to_play | Double |  |
| post_video_views_organic | Double |  |
| post_video_views_organic_unique | Double |  |
| post_video_views_paid | Double |  |
| post_video_views_paid_unique | Double |  |
| post_video_views_sound_on | Double |  |
| post_video_views_unique | Double |  |

### post_metrics_by_age_gender

| Column | Type | Keys |
| --- | --- | --- |
| age_gender | String | PK |
| date | Instant | PK |
| post_id | String | PK, FK |
| post_video_view_time_by_age_bucket_and_gender | Double |  |

### post_comment_history

| Column | Type | Keys |
| --- | --- | --- |
| _fivetran_id | String | PK |
| post_id | String | FK |
| can_comment | Boolean |  |
| can_hide | Boolean |  |
| can_like | Boolean |  |
| can_remove | Boolean |  |
| can_reply_privately | Boolean |  |
| comment_count | Long |  |
| created_time | Instant |  |
| from_object | Json |  |
| id | String |  |
| like_count | Long |  |
| message | String |  |
| message_tags | Json |  |
| object | Json |  |
| parent_id | String |  |
| user_likes | Boolean |  |
| attachment_** |  |  |

## Relationships

- page_metrics_by_monetization_tool(page_id) → page(id)
- reel_metrics_total(reel_id) → reel_history(id)
- post_metrics_by_video_interval(post_id) → post_history(id)
- post_monetization_metrics(post_id) → post_history(id)
- page_metrics_by_country(page_id) → page(id)
- post_video_property_history(post_id) → post_history(id)
- post_video_property_history(updated_time) → post_history(id)
- post_metrics_by_followers(post_id) → post_history(id)
- page_metrics_by_crosspost_status(page_id) → page(id)
- page_metrics_by_earning_source(page_id) → page(id)
- page_metrics_by_paid_organic(page_id) → page(id)
- post_attachment_history(post_id) → post_history(id)
- post_attachment_history(updated_time) → post_history(id)
- post_metrics_by_paid_organic(post_id) → post_history(id)
- post_metrics_by_action_type(post_id) → post_history(id)
- page_metrics_by_city(page_id) → page(id)
- page_metrics_total(page_id) → page(id)
- post_metrics_by_locale(post_id) → post_history(id)
- page_video_history(page_id) → page(id)
- post_metrics_by_country(post_id) → post_history(id)
- reel_metrics_by_type(reel_id) → reel_history(id)
- page_metrics_by_paid_non_paid(page_id) → page(id)
- reel_history(page_id) → page(id)
- post_history(page_id) → page(id)
- post_tagged_profile_history(post_id) → post_history(id)
- post_tagged_profile_history(updated_time) → post_history(id)
- page_video_thumbnail(video_id) → page_video_history(id)
- page_monetization_metrics(page_id) → page(id)
- post_metrics_by_type(post_id) → post_history(id)
- post_metrics_by_monetization_tool(post_id) → post_history(id)
- post_metrics_total(post_id) → post_history(id)
- post_metrics_by_age_gender(post_id) → post_history(id)
- post_comment_history(post_id) → post_history(id)
