# X Ads schema ERD

Table and field reference for the Fivetran X Ads connector.

## Table & Field Reference

### tweet_hashtag

| Column | Type | Keys |
| --- | --- | --- |
| index | Long | PK |
| tweet_id | String | PK, FK |
| indices | Json |  |
| text | String |  |

### card_component

| Column | Type | Keys |
| --- | --- | --- |
| index | Int | PK |
| card_id | String | PK, FK |
| label_type | String |  |
| label_value | String |  |
| media_key | String |  |
| title | String |  |
| type | String |  |
| destination_** |  |  |

### scheduled_tweet_history

| Column | Type | Keys |
| --- | --- | --- |
| id | String | PK |
| updated_at | Instant | PK |
| account_id | String | FK |
| tweet_id | String | FK |
| card_uri | String |  |
| completed_at | Instant |  |
| created_at | Instant |  |
| nullcast | Boolean |  |
| scheduled_at | Instant |  |
| scheduled_status | String |  |
| text | String |  |
| user_id | String |  |

### funding_instrument_history

| Column | Type | Keys |
| --- | --- | --- |
| id | String | PK |
| updated_at | Instant | PK |
| account_id | String | FK |
| able_to_fund | Boolean |  |
| created_at | Instant |  |
| credit_limit_local_micro | Long |  |
| credit_remaining_local_micro | Long |  |
| currency | String |  |
| deleted | Boolean |  |
| description | String |  |
| end_time | Instant |  |
| entity_status | String |  |
| funded_amount_local_micro | Long |  |
| io_header | String |  |
| start_time | Instant |  |
| type | String |  |

### line_item_history

| Column | Type | Keys |
| --- | --- | --- |
| id | String | PK |
| updated_at | Instant | PK |
| campaign_id | String | FK |
| advertiser_domain | String |  |
| advertiser_user_id | Long |  |
| bid_amount_local_micro | Long |  |
| bid_strategy | String |  |
| bid_unit | String |  |
| charge_by | String |  |
| created_at | Instant |  |
| creative_source | String |  |
| currency | String |  |
| deleted | Boolean |  |
| end_time | Instant |  |
| entity_status | String |  |
| name | String |  |
| objective | String |  |
| optimization | String |  |
| primary_web_event_tag | String |  |
| product_type | String |  |
| start_time | Instant |  |
| target_cpa_local_micro | Long |  |
| total_budget_amount_local_micro | Long |  |

### tweet

| Column | Type | Keys |
| --- | --- | --- |
| id | String | PK |
| account_id | String | FK |
| user_id | Long | FK |
| card_uri | String |  |
| coordinates_coordinates | Json |  |
| coordinates_type | String |  |
| created_at | Instant |  |
| favorite_count | Long |  |
| favorited | Boolean |  |
| followers | Boolean |  |
| full_text | String |  |
| geo_coordinates | Json |  |
| geo_type | String |  |
| in_reply_to_screen_name | String |  |
| in_reply_to_status_id | String |  |
| in_reply_to_user_id | String |  |
| lang | String |  |
| media_key | String |  |
| name | String |  |
| retweet_count | Long |  |
| retweeted | Boolean |  |
| source | String |  |
| truncated | Boolean |  |
| tweet_type | String |  |

### line_item_category_history

| Column | Type | Keys |
| --- | --- | --- |
| index | Long | PK |
| line_item_id | String | PK, FK |
| line_item_updated_at | Instant | PK, FK |
| category | String |  |

### line_item_tracking_tag_history

| Column | Type | Keys |
| --- | --- | --- |
| index | Long | PK |
| line_item_id | String | PK, FK |
| line_item_updated_at | Instant | PK, FK |
| tracking_partner | String |  |
| tracking_tag | String |  |

### card_history

| Column | Type | Keys |
| --- | --- | --- |
| id | String | PK |
| updated_at | Instant | PK |
| account_id | String | FK |
| app_cta | String |  |
| card_type | String |  |
| card_uri | String |  |
| content_duration_seconds | Long |  |
| country_code | String |  |
| created_at | Instant |  |
| deleted | Boolean |  |
| duration_in_minutes | Long |  |
| end_time | Instant |  |
| first_choice | String |  |
| first_cta | String |  |
| first_cta_tweet | String |  |
| first_cta_welcome_message_id | String |  |
| googleplay_app_id | String |  |
| image_display_height | String |  |
| image_display_width | String |  |
| media_key | String |  |
| media_url | String |  |
| name | String |  |
| poster_media_url | String |  |
| recipient_user_id | String |  |
| second_choice | String |  |
| start_time | Instant |  |
| thank_you_text | String |  |
| title | String |  |
| video_height | String |  |
| video_hls_url | String |  |
| video_owner_id | String |  |
| video_poster_height | String |  |
| video_poster_url | String |  |
| video_poster_width | String |  |
| video_url | String |  |
| video_width | String |  |
| website_dest_url | String |  |
| website_display_url | String |  |
| website_shortened_url | String |  |
| website_title | String |  |
| website_url | String |  |

### promoted_account_history

| Column | Type | Keys |
| --- | --- | --- |
| id | String | PK |
| line_item_id | String | FK |
| approval_status | String |  |
| created_at | Instant |  |
| deleted | Boolean |  |
| entity_status | String |  |
| updated_at | Instant |  |
| user_id | String |  |

### funding_instrument_reason_history

| Column | Type | Keys |
| --- | --- | --- |
| index | Long | PK |
| funding_instrument_id | String | PK, FK |
| funding_instrument_updated_at | Instant | PK, FK |
| reason_not_able_to_fund | String |  |

### campaign_history

| Column | Type | Keys |
| --- | --- | --- |
| id | String | PK |
| updated_at | Instant | PK |
| account_id | String | FK |
| funding_instrument_id | String | FK |
| budget_optimization | String |  |
| created_at | Instant |  |
| currency | String |  |
| daily_budget_amount_local_micro | Long |  |
| deleted | Boolean |  |
| duration_in_days | Long |  |
| end_time | Instant |  |
| entity_status | String |  |
| frequency_cap | Long |  |
| name | String |  |
| servable | Boolean |  |
| standard_delivery | Boolean |  |
| start_time | Instant |  |
| total_budget_amount_local_micro | Long |  |

### tracking_tag_history

| Column | Type | Keys |
| --- | --- | --- |
| id | String | PK |
| updated_at | Instant | PK |
| line_item_id | String | FK |
| created_at | Instant |  |
| deleted | Boolean |  |
| tracking_tag_type | String |  |
| tracking_tag_url | String |  |

### media_library

| Column | Type | Keys |
| --- | --- | --- |
| media_key | String | PK |
| created_at | Instant |  |
| deleted | Boolean |  |
| duration | Long |  |
| file_name | String |  |
| media_category | String |  |
| media_status | String |  |
| media_type | String |  |
| media_url | String |  |
| name | String |  |
| original_height | Long |  |
| original_width | Long |  |
| poster_media_key | String |  |
| poster_media_url | String |  |
| tweeted | Boolean |  |
| updated_at | Instant |  |

### tweet_media

| Column | Type | Keys |
| --- | --- | --- |
| media_id | String | PK |
| tweet_id | String | PK, FK |
| display_url | String |  |
| expanded_url | String |  |
| indices | Json |  |
| media_key | String |  |
| media_url | String |  |
| media_url_https | String |  |
| sizes | Json |  |
| type | String |  |
| url | String |  |

### media_creative_history

| Column | Type | Keys |
| --- | --- | --- |
| id | String | PK |
| updated_at | Instant | PK |
| account_media_id | String | FK |
| line_item_id | String | FK |
| approval_status | String |  |
| created_at | Instant |  |
| deleted | Boolean |  |
| entity_status | String |  |
| landing_url | String |  |

### account_media_history

| Column | Type | Keys |
| --- | --- | --- |
| id | String | PK |
| updated_at | Instant | PK |
| account_id | String | FK |
| created_at | Instant |  |
| creative_type | String |  |
| deleted | Boolean |  |
| media_key | String |  |
| media_url | String |  |
| vast_url | String |  |

### promoted_tweet_history

| Column | Type | Keys |
| --- | --- | --- |
| id | String | PK |
| updated_at | Instant | PK |
| line_item_id | String | FK |
| tweet_id | String | FK |
| approval_status | String |  |
| created_at | Instant |  |
| deleted | Boolean |  |
| entity_status | String |  |

### tweet_user_mention

| Column | Type | Keys |
| --- | --- | --- |
| id | String | PK |
| tweet_id | String | PK, FK |
| indices | Json |  |
| name | String |  |
| screen_name | String |  |

### line_item_placement_history

| Column | Type | Keys |
| --- | --- | --- |
| index | Long | PK |
| line_item_id | String | PK, FK |
| line_item_updated_at | Instant | PK, FK |
| placement | String |  |

### account_history

| Column | Type | Keys |
| --- | --- | --- |
| id | String | PK |
| updated_at | Instant | PK |
| approval_status | String |  |
| business_id | String |  |
| business_name | String |  |
| created_at | Instant |  |
| deleted | Boolean |  |
| industry_type | String |  |
| name | String |  |
| salt | String |  |
| timezone | String |  |
| timezone_switch_at | Instant |  |

### tweet_symbols

| Column | Type | Keys |
| --- | --- | --- |
| index | Long | PK |
| tweet_id | String | PK, FK |
| indices | Json |  |
| text | String |  |

### campaign_reason_history

| Column | Type | Keys |
| --- | --- | --- |
| index | Long | PK |
| campaign_id | String | PK, FK |
| campaign_updated_at | Instant | PK, FK |
| reason_not_servable | String |  |

### twitter_user_history

| Column | Type | Keys |
| --- | --- | --- |
| id | Long | PK |
| contributors_enabled | Boolean |  |
| created_at | Instant |  |
| default_profile | Boolean |  |
| default_profile_image | Boolean |  |
| description | String |  |
| favourites_count | Int |  |
| followers_count | Int |  |
| following | Boolean |  |
| friends_count | Int |  |
| geo_enabled | Boolean |  |
| is_translation_enabled | Boolean |  |
| is_translator | Boolean |  |
| lang | String |  |
| listed_count | Int |  |
| location | String |  |
| name | String |  |
| profile_background_image_url | String |  |
| profile_background_image_url_https | String |  |
| profile_background_tile | Boolean |  |
| profile_banner_url | String |  |
| profile_image_url | String |  |
| profile_image_url_https | String |  |
| profile_use_background_image | String |  |
| protected_user | Boolean |  |
| screen_name | String |  |
| statuses_count | Int |  |
| time_zone | String |  |
| url | String |  |
| utc_offset | Int |  |
| verified | Boolean |  |

### preroll_call_to_actions_history

| Column | Type | Keys |
| --- | --- | --- |
| id | String | PK |
| updated_at | Instant | PK |
| line_item_id | String | FK |
| call_to_action | String |  |
| call_to_action_url | String |  |
| created_at | Instant |  |
| deleted | Boolean |  |

### scheduled_promoted_tweets_history

| Column | Type | Keys |
| --- | --- | --- |
| id | String | PK |
| updated_at | Instant | PK |
| line_item_id | String | FK |
| scheduled_tweet_id | String | FK |
| tweet_id | String | FK |
| created_at | Instant |  |
| deleted | Boolean |  |

### tweet_url

| Column | Type | Keys |
| --- | --- | --- |
| index | Long | PK |
| tweet_id | String | PK, FK |
| display_url | String |  |
| expanded_url | String |  |
| indices | Json |  |
| url | String |  |

## Relationships

- tweet_hashtag(tweet_id) → tweet(id)
- card_component(card_id) → card_history(id)
- scheduled_tweet_history(tweet_id) → tweet(id)
- scheduled_tweet_history(account_id) → account_history(id)
- funding_instrument_history(account_id) → account_history(id)
- line_item_history(campaign_id) → campaign_history(id)
- tweet(account_id) → account_history(id)
- tweet(user_id) → twitter_user_history(id)
- line_item_category_history(line_item_id) → line_item_history(id)
- line_item_category_history(line_item_updated_at) → line_item_history(id)
- line_item_tracking_tag_history(line_item_id) → line_item_history(id)
- line_item_tracking_tag_history(line_item_updated_at) → line_item_history(id)
- card_history(account_id) → account_history(id)
- promoted_account_history(line_item_id) → line_item_history(id)
- funding_instrument_reason_history(funding_instrument_id) → funding_instrument_history(id)
- funding_instrument_reason_history(funding_instrument_updated_at) → funding_instrument_history(id)
- campaign_history(account_id) → account_history(id)
- campaign_history(funding_instrument_id) → funding_instrument_history(id)
- tracking_tag_history(line_item_id) → line_item_history(id)
- tweet_media(tweet_id) → tweet(id)
- media_creative_history(line_item_id) → line_item_history(id)
- media_creative_history(account_media_id) → account_media_history(id)
- account_media_history(account_id) → account_history(id)
- promoted_tweet_history(line_item_id) → line_item_history(id)
- promoted_tweet_history(tweet_id) → tweet(id)
- tweet_user_mention(tweet_id) → tweet(id)
- line_item_placement_history(line_item_id) → line_item_history(id)
- line_item_placement_history(line_item_updated_at) → line_item_history(id)
- tweet_symbols(tweet_id) → tweet(id)
- campaign_reason_history(campaign_id) → campaign_history(id)
- campaign_reason_history(campaign_updated_at) → campaign_history(id)
- preroll_call_to_actions_history(line_item_id) → line_item_history(id)
- scheduled_promoted_tweets_history(line_item_id) → line_item_history(id)
- scheduled_promoted_tweets_history(scheduled_tweet_id) → scheduled_tweet_history(id)
- scheduled_promoted_tweets_history(tweet_id) → tweet(id)
- tweet_url(tweet_id) → tweet(id)
