-- Track what scheduled or manual path queued a given log review. Lets the
-- review processor distinguish a daily heartbeat (which should email even
-- when nothing's wrong, so the customer can confirm monitoring is alive)
-- from ad-hoc / cadenced runs (which still suppress no-finding emails to
-- avoid inbox spam).
--
-- Values currently used:
--   'daily'           - scheduled-site-checks.php --daily (08:00 server time)
--   'initial'         - scheduled-site-checks.php --initial (every 15 min)
--   'periodic'        - scheduled-site-checks.php --periodic (legacy/reserved)
--   'manual'          - user-clicked "Run Analysis" from the panel
--   'traffic_request' - on-demand traffic analysis request

USE whp;

ALTER TABLE ai_monitor_log_reviews
    ADD COLUMN IF NOT EXISTS triggered_by VARCHAR(32) NOT NULL DEFAULT 'manual'
        COMMENT 'Source that queued this review: daily|initial|periodic|manual|traffic_request'
        AFTER request_type;
