0"); mysqli_query($mysqli, "ALTER TABLE `canned_responses` DROP KEY `canned_response_category_id`, DROP `canned_response_category_id`"); // Each time one goes into a reply - who, on which ticket and when mysqli_query($mysqli, "CREATE TABLE `canned_response_uses` ( `canned_response_use_id` int(11) NOT NULL AUTO_INCREMENT, `canned_response_use_canned_response_id` int(11) NOT NULL, `canned_response_use_user_id` int(11) NOT NULL DEFAULT 0, `canned_response_use_ticket_id` int(11) NOT NULL DEFAULT 0, `canned_response_use_created_at` datetime NOT NULL DEFAULT current_timestamp(), PRIMARY KEY (`canned_response_use_id`), KEY `canned_response_use_canned_response_id` (`canned_response_use_canned_response_id`,`canned_response_use_created_at`), KEY `canned_response_use_user_id` (`canned_response_use_user_id`), CONSTRAINT `canned_response_uses_ibfk_1` FOREIGN KEY (`canned_response_use_canned_response_id`) REFERENCES `canned_responses` (`canned_response_id`) ON DELETE CASCADE ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci");