-- =====================================================================
--  Migration: background processing (cron worker) + email notifications
--
--  Safe to run on an EXISTING database — only adds new columns; nothing
--  here touches or deletes existing data.
--
--  Run:  mysql -u root -p email_verifier < migrations/003_notifications.sql
-- =====================================================================

ALTER TABLE verification_jobs
    ADD COLUMN notify_email VARCHAR(255) NULL AFTER status,
    ADD COLUMN notified_at  DATETIME     NULL AFTER notify_email;

INSERT IGNORE INTO app_settings (setting_key, setting_value) VALUES
    ('default_notify_email', '');

-- Reminder: also set a real cron.key in app/config/config.php (separate
-- from setup.key) before scheduling public/api/cron.php — see README.
