ALTER TABLE `swspkmas`.`th_study_auth`
ADD COLUMN `ip` varchar(30) NULL,
ADD COLUMN `max` varchar(40) NULL;

CREATE TABLE `swspkmas`.`tr_cert`  (
`id` bigint NOT NULL AUTO_INCREMENT,
`uuid` varchar(30) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
`name` varchar(30) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
`idcard` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
`institution_id` bigint NOT NULL,
`institution_name` varchar(60) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
`batch_uuid` varchar(30) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
`del_flag` tinyint NOT NULL DEFAULT 0,
`train_org_name` varchar(30) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
`cert_url` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
`cert_time` datetime NOT NULL,
`create_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
`create_by` varchar(30) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL,
`update_time` datetime NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
`update_by` varchar(30) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL,
PRIMARY KEY (`id`) USING BTREE,
UNIQUE INDEX `index_uuid`(`uuid`) USING BTREE,
INDEX `index_idcard`(`idcard`) USING BTREE,
INDEX `index_batchuuid`(`batch_uuid`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci ROW_FORMAT = DYNAMIC;


ALTER TABLE `swspkmas`.`th_course_chapter`
ADD COLUMN `teacher` varchar(50) NULL COMMENT '讲师';


drop table if exists `swspkmas`.`th_question_bank`;
CREATE TABLE `swspkmas`.`th_question_bank`  (
`id` bigint NOT NULL AUTO_INCREMENT,
`uuid` varchar(40) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
`institution_id` bigint NOT NULL,
`institution_name` varchar(30) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
`total_count` int NOT NULL COMMENT '题库题目总数量',
`single_count` int NOT NULL COMMENT '单选题题目数量',
`multi_count` int NOT NULL COMMENT '多选题题目数量',
`judge_count` int NOT NULL COMMENT '判断题题目数量',
`easy_count` int NOT NULL COMMENT '简答题题目数量',
`mix_count` int NOT NULL COMMENT '混合题题目数量',
`other_count` int NOT NULL COMMENT '其他数量',
`del_flag` tinyint NOT NULL DEFAULT 0,
`create_time` datetime NULL DEFAULT CURRENT_TIMESTAMP,
`create_by` varchar(30) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL,
`update_by` varchar(30) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL,
`update_time` datetime NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
PRIMARY KEY (`id`) USING BTREE,
UNIQUE INDEX `index_uuid`(`uuid`) USING BTREE,
INDEX `index_institution_id`(`institution_id`) USING BTREE
) ENGINE = InnoDB  AUTO_INCREMENT = 1 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci ROW_FORMAT = DYNAMIC;
