-- Track which fmcsa_carriers records have been added to Listmonk campaign lists,
-- so the daily campaign builder never double-sends to the same carrier.

ALTER TABLE fmcsa_carriers
  ADD COLUMN IF NOT EXISTS listmonk_sent_at TIMESTAMPTZ,
  ADD COLUMN IF NOT EXISTS listmonk_campaign_type TEXT;

CREATE INDEX IF NOT EXISTS idx_fmcsa_carriers_listmonk_sent
  ON fmcsa_carriers (listmonk_sent_at)
  WHERE listmonk_sent_at IS NULL;
