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)

Columns of the ads table
ColumnTypeConstraintsDescription
iduuidprimary key
campaign_iduuidnot null, references ad_campaigns.id
post_iduuidreferences posts.id
headlinevarchar(300)not null
destination_urlvarchar(2000)not null
call_to_actionvarchar(40)
creative_asset_iduuidreferences media_assets.id
statusad_statusnot null
review_notevarchar(500)

Indexes (1)

  • (campaign_id, status)

Relationships