----------------------------------------------------------------后端服务启动前执行-----------------------------------------------------------------------------------------
--新增字段，记录网考重审操作触发阅卷追加的时间戳
ALTER TABLE `ec_m_mark_work` ADD COLUMN `append_time`  bigint(20) NULL DEFAULT NULL;

--新增索引
CREATE INDEX `IDX_M_MARK_WORK_001` ON `ec_m_mark_work`(`root_org_id`, `exam_id`) USING BTREE ;

CREATE INDEX `IDX_M_MARK_ITEM_001` ON `ec_m_mark_item`(`work_id`, `base_paper_id`, `question_id`, `main_number`, `sub_number`, `orders`) USING BTREE ;

--新增表，评卷工作可选多个考试
CREATE TABLE `ec_m_mark_work_exam` (
  `id` bigint(20) NOT NULL AUTO_INCREMENT,
  `exam_id` bigint(20) DEFAULT NULL,
  `work_id` bigint(20) DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `IDX_M_MARK_WORK_EXAM_001` (`work_id`,`exam_id`),
  KEY `IDX_M_MARK_WORK_EXAM_002` (`exam_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

--老数据处理，评卷工作可选多个考试
INSERT INTO  ec_m_mark_work_exam(work_id,exam_id)  SELECT   id,exam_id  FROM ec_m_mark_work;
----------------------------------------------------------------后端服务启动后执行------------------------------------------------------------------------------------------


