ads table
The ads table in the Reddit Clone Database Schema schema has 9 columns, keyed by id, with 3 foreign keys to ad_campaigns, posts and media_assets. 1 column in ad_metrics_daily references it.
A promoted post is a real posts row with is_promoted set, which is what lets it be voted on, commented on and reported through exactly the same machinery as organic content.
Columns (9)
| Column | Type | Constraints | Description |
|---|---|---|---|
| id | uuid | primary key | |
| campaign_id | uuid | not null, references ad_campaigns.id | |
| post_id | uuid | references posts.id | |
| headline | varchar(300) | not null | |
| destination_url | varchar(2000) | not null | |
| call_to_action | varchar(40) | ||
| creative_asset_id | uuid | references media_assets.id | |
| status | ad_status | not null | |
| review_note | varchar(500) |
Indexes (1)
(campaign_id, status)
Relationships
ads.campaign_idreferencesad_campaigns.idads.post_idreferencesposts.idads.creative_asset_idreferencesmedia_assets.idad_metrics_daily.ad_idreferencesads