Email Routing): a client and a contact, a category, a priority, an * agent and a ticket template - 0 or '' for each it leaves as it is - with why, who added it, and how many emails * it routed and when the last was * * Re-runnable: the table is made only where it isn't there. */ defined('FROM_DB_UPDATER') || die("Direct file access is not allowed"); mysqli_query($mysqli, "CREATE TABLE IF NOT EXISTS `email_routing_rules` ( `routing_rule_id` int(11) NOT NULL AUTO_INCREMENT, `routing_rule_match` varchar(255) NOT NULL, `routing_rule_subject` varchar(255) NOT NULL DEFAULT '', `routing_rule_client_id` int(11) NOT NULL DEFAULT 0, `routing_rule_contact_id` int(11) NOT NULL DEFAULT 0, `routing_rule_category_id` int(11) NOT NULL DEFAULT 0, `routing_rule_priority` varchar(20) NOT NULL DEFAULT '', `routing_rule_assigned_to` int(11) NOT NULL DEFAULT 0, `routing_rule_ticket_template_id` int(11) NOT NULL DEFAULT 0, `routing_rule_note` varchar(255) NOT NULL DEFAULT '', `routing_rule_matches` int(11) NOT NULL DEFAULT 0, `routing_rule_matched_at` datetime DEFAULT NULL, `routing_rule_created_by` int(11) NOT NULL DEFAULT 0, `routing_rule_created_at` datetime NOT NULL DEFAULT current_timestamp(), `routing_rule_updated_at` datetime DEFAULT NULL ON UPDATE current_timestamp(), PRIMARY KEY (`routing_rule_id`), KEY `routing_rule_match` (`routing_rule_match`), KEY `routing_rule_client_id` (`routing_rule_client_id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci");