

CREATE TABLE IF NOT EXISTS advertisers (
  id INT UNSIGNED NOT NULL AUTO_INCREMENT,
  name VARCHAR(200) NOT NULL,
  category VARCHAR(100) NULL,
  created_at TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP,
  PRIMARY KEY (id),
  UNIQUE KEY uq_advertisers_name (name)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

-- Seed data (safe-ish): insert only if missing.
INSERT INTO advertisers (name, category)
SELECT 'Demo Advertiser', 'OTT'
WHERE NOT EXISTS (SELECT 1 FROM advertisers WHERE name = 'Demo Advertiser');

