CREATE TABLE IF NOT EXISTS facebook_audit_requests (
 id BIGINT UNSIGNED AUTO_INCREMENT PRIMARY KEY,
 facebook_group_id BIGINT UNSIGNED NOT NULL,
 status ENUM('requested','in_progress','completed','blocked') NOT NULL DEFAULT 'requested',
 requested_at DATETIME NOT NULL,
 started_at DATETIME NULL,
 completed_at DATETIME NULL,
 note TEXT NULL,
 UNIQUE KEY group_request (facebook_group_id),
 INDEX status_requested (status,requested_at),
 CONSTRAINT fk_facebook_audit_request_group FOREIGN KEY (facebook_group_id) REFERENCES facebook_groups(id) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
