DROP TABLE IF EXISTS `user_discounts`;
CREATE TABLE `user_discounts` (
                                  `id` int NOT NULL AUTO_INCREMENT,
                                  `user_id` int NOT NULL,
                                  `select_user_id` int NOT NULL,
                                  `select_customer_id` int NOT NULL,
                                  `customer_group_id` int NOT NULL,
                                  `user_group_id` int NOT NULL,
                                  `publisher_id` int NOT NULL,
                                  `name` varchar(150) NOT NULL,
                                  `rate` float NOT NULL,
                                  `priority` int NOT NULL,
                                  `discount_type` varchar(20) NOT NULL,
                                  `status` tinyint(1) NOT NULL DEFAULT '0',
                                  `start_date` datetime NOT NULL,
                                  `end_date` datetime NOT NULL,
                                  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3;