----------------------------------------------------------------后端服务启动前执行-----------------------------------------------------------------------------------------
CREATE TABLE `ec_oe_exam_record_data_sync` (
	`id` BIGINT (20) NOT NULL AUTO_INCREMENT,
	`creation_time` datetime NOT NULL,
	`update_time` datetime NOT NULL,
	`cache_id` BIGINT (20) NULL DEFAULT NULL,
	`db_id` BIGINT (20) NULL DEFAULT NULL,
	PRIMARY KEY (`id`),
	UNIQUE INDEX `IDX_E_O_E_R_D_S_001` (`cache_id`) USING BTREE
) ENGINE = INNODB DEFAULT CHARACTER
SET = utf8 COLLATE = utf8_general_ci ROW_FORMAT = Dynamic;

ALTER TABLE `ec_oe_exam_student` ADD COLUMN `extra_num` INT (11) NULL DEFAULT NULL AFTER `student_name`;

ALTER TABLE `ec_oe_exam_student` ADD COLUMN `used_num` INT (11) NULL DEFAULT NULL AFTER `extra_num`;

ALTER TABLE `ec_oe_exam_student` DROP COLUMN `normal_exam_times`;

ALTER TABLE `ec_oe_exam_student` DROP COLUMN `is_reexamine`;

ALTER TABLE `ec_oe_exam_student` DROP COLUMN `reexamine_completed`;

CREATE TABLE `ec_oe_exam_student_final_score` (
	`id` BIGINT (20) NOT NULL AUTO_INCREMENT,
	`creation_time` datetime NOT NULL,
	`update_time` datetime NOT NULL,
	`exam_record_data_id` BIGINT (20) NOT NULL,
	`exam_student_id` BIGINT (20) NOT NULL,
	`objective_accuracy` DOUBLE NULL DEFAULT NULL,
	`objective_score` DOUBLE NULL DEFAULT NULL,
	`subjective_score` DOUBLE NULL DEFAULT NULL,
	`succ_percent` DOUBLE NULL DEFAULT NULL,
	`total_score` DOUBLE NULL DEFAULT NULL,
	PRIMARY KEY (`id`),
	UNIQUE INDEX `IDX_E_O_E_S_F_S_001` (`exam_student_id`) USING BTREE,
	INDEX `IDX_E_O_E_S_F_S_002` (`exam_record_data_id`) USING BTREE
) ENGINE = INNODB DEFAULT CHARACTER
SET = utf8 COLLATE = utf8_general_ci ROW_FORMAT = Dynamic;

-- 初始化考生表中新加字段的值
update ec_oe_exam_student set used_num=0  where used_num is null;
update ec_oe_exam_student set  extra_num=0 where extra_num is null;

----------------------------------------------------------------后端服务启动后执行------------------------------------------------------------------------------------------


