CREATE TABLE IF NOT EXISTS `holiday` (
  `id` bigint NOT NULL AUTO_INCREMENT,
  `date` date NOT NULL COMMENT 'holiday date',
  `type` tinyint NOT NULL COMMENT '1-holiday(rest) 2-workday(makeup)',
  `name` varchar(50) DEFAULT NULL COMMENT 'holiday name',
  `status` tinyint NOT NULL DEFAULT 1,
  `deleted` tinyint NOT NULL DEFAULT 0,
  `created_at` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
  `updated_at` datetime DEFAULT NULL ON UPDATE CURRENT_TIMESTAMP,
  PRIMARY KEY (`id`),
  UNIQUE KEY `uk_holiday_date` (`date`,`deleted`),
  KEY `idx_holiday_type` (`type`,`status`,`deleted`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

ALTER TABLE `plan_model_type` ADD COLUMN `holiday_mode` tinyint NOT NULL DEFAULT 0 COMMENT '0-default 1-ignore 2-holiday-only' AFTER `date_info`;
