USE `cnbg`;

SET NAMES utf8mb4;
SET FOREIGN_KEY_CHECKS = 0;

-- ----------------------------
-- Table structure for wm_quiz
-- ----------------------------
DROP TABLE IF EXISTS `wm_quiz`;
CREATE TABLE `wm_quiz`
(
    `quiz_id`      INT AUTO_INCREMENT COMMENT 'Id',
    `serial_num`   VARCHAR(64)  NOT NULL COMMENT '序列号',
    `quiz_title`   VARCHAR(64)  NOT NULL COMMENT '标题',
    `introduction` VARCHAR(255) NULL COMMENT '简介',
    `source_type`  VARCHAR(8)   NOT NULL COMMENT '问卷来源类型',
    `quiz_state`   VARCHAR(8)   NOT NULL COMMENT '问卷状态',
    `ent_id`       INT UNSIGNED NOT NULL COMMENT '企业信息',
    `quiz_expand`  JSON COMMENT '试卷统计',
    `create_by`    VARCHAR(64)  NOT NULL COMMENT '创建人',
    `update_by`    VARCHAR(64)  NOT NULL COMMENT '修改人',
    `create_time`  DATETIME     NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
    `update_time`  DATETIME     NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间',
    PRIMARY KEY `pk_id` (`quiz_id`) USING BTREE,
    UNIQUE KEY `uk_sn` (`serial_num`) USING BTREE,
    INDEX `idx_st` (`source_type`) USING BTREE,
    INDEX `idx_state` (`quiz_state`) USING BTREE,
    INDEX `idx_eid` (`ent_id`) USING BTREE
) ENGINE = InnoDB
    COMMENT ='试卷表';


SET FOREIGN_KEY_CHECKS = 1;
