ad_targeting_rules table
The ad_targeting_rules table in the Reddit Clone Database Schema schema has 5 columns, keyed by id, with 1 foreign key to ad_campaigns.
Include and exclude rules in one table with an operator, because targeting is always a set expression and splitting it into two tables makes evaluation order ambiguous.
Columns (5)
| Column | Type | Constraints | Description |
|---|---|---|---|
| id | uuid | primary key | |
| campaign_id | uuid | not null, references ad_campaigns.id | |
| dimension | targeting_dimension | not null | |
| operator | targeting_operator | not null | |
| value | varchar(200) | not null |
Indexes (1)
(campaign_id, dimension)
Relationships
ad_targeting_rules.campaign_idreferencesad_campaigns.id