CREATE TABLE IF NOT EXISTS audit_material_item_review (
    id BIGINT UNSIGNED NOT NULL AUTO_INCREMENT PRIMARY KEY,
    tenant_id BIGINT UNSIGNED NOT NULL,
    meeting_id BIGINT UNSIGNED NOT NULL,
    task_id BIGINT UNSIGNED NOT NULL,
    review_node VARCHAR(32) NOT NULL,
    module_code VARCHAR(32) NOT NULL,
    item_key VARCHAR(128) NOT NULL,
    item_label VARCHAR(255) NOT NULL,
    review_result VARCHAR(16) NOT NULL,
    review_reason VARCHAR(500) DEFAULT NULL,
    reviewer_user_id BIGINT UNSIGNED NOT NULL DEFAULT 0,
    created_at DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP,
    updated_at DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
    UNIQUE KEY uk_task_node_module_item (tenant_id, task_id, review_node, module_code, item_key),
    KEY idx_tenant_meeting_module (tenant_id, meeting_id, module_code),
    KEY idx_tenant_task_node (tenant_id, task_id, review_node)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
