-- ----------------------------
-- 课时批次表
-- ----------------------------
drop table if exists `train_exam`.`ex_course_phase`;
CREATE TABLE `train_exam`.`ex_course_phase`  (
`id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT COMMENT '主键' ,
`code` varchar(12) NOT NULL COMMENT '批次编号',
`name` varchar(30) NOT NULL COMMENT '批次名称',
`company_id` bigint NOT NULL COMMENT '创建企业id',
`course_id` bigint NOT NULL COMMENT '课程id',
`del_flag` tinyint NULL DEFAULT 0 COMMENT '删除标志(0代表存在，1代表删除，默认0)',
`level` tinyint NOT NULL DEFAULT 1 COMMENT '批次级别(1公司级 2部门级 3车间级 默认1)',
`create_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
`create_by` varchar(50) NULL DEFAULT NULL COMMENT '创建人',
`update_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间',
`update_by` varchar(50) NULL DEFAULT NULL COMMENT '更新人',
`remark` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '备注',
`version` int NULL DEFAULT 0 COMMENT '乐观锁',
PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '课时批次表' ROW_FORMAT = DYNAMIC;
