-- Campaign-level auto follow-up when recipient does not reply within N hours.

ALTER TABLE email_campaigns
  ADD COLUMN followup_enabled TINYINT(1) NOT NULL DEFAULT 0 AFTER body_text,
  ADD COLUMN followup_delay_hours INT UNSIGNED NOT NULL DEFAULT 72 AFTER followup_enabled,
  ADD COLUMN followup_template_id INT NULL AFTER followup_delay_hours,
  ADD COLUMN followup_subject VARCHAR(500) NULL AFTER followup_template_id,
  ADD COLUMN followup_body_html MEDIUMTEXT NULL AFTER followup_subject;

ALTER TABLE campaign_contact_followups
  MODIFY action_type ENUM('reminder', 'resend_email', 'followup_template') NOT NULL;
