-- ----------------------------
-- Table structure for sys_log_longtext
-- ----------------------------
DROP TABLE IF EXISTS `sys_log_longtext`;
CREATE TABLE `sys_log_longtext`  (
  `id` bigint NOT NULL AUTO_INCREMENT,
  `sys_id` bigint NULL DEFAULT NULL,
  `params` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL COMMENT '请求参数',
  `result` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL COMMENT '结果',
  PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_0900_ai_ci ROW_FORMAT = Dynamic;

-- ----------------------------
-- Table structure for sys_log_mediumtext
-- ----------------------------
DROP TABLE IF EXISTS `sys_log_mediumtext`;
CREATE TABLE `sys_log_mediumtext`  (
  `id` bigint NOT NULL AUTO_INCREMENT,
  `sys_id` bigint NULL DEFAULT NULL,
  `params` mediumtext CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL COMMENT '请求参数',
  `result` mediumtext CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL COMMENT '结果',
  PRIMARY KEY (`id`) USING BTREE,
  INDEX `sys_id`(`sys_id`) USING BTREE
) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_0900_ai_ci ROW_FORMAT = Dynamic;

-- ----------------------------
-- Table structure for sys_log_text
-- ----------------------------
DROP TABLE IF EXISTS `sys_log_text`;
CREATE TABLE `sys_log_text`  (
  `id` bigint NOT NULL AUTO_INCREMENT,
  `sys_id` bigint NULL DEFAULT NULL,
  `params` text CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL COMMENT '请求参数',
  `result` text CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL COMMENT '结果',
  PRIMARY KEY (`id`) USING BTREE,
  INDEX `sys_id`(`sys_id`) USING BTREE
) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_0900_ai_ci ROW_FORMAT = Dynamic;


drop table if exists resources_question_snapshot;

/*==============================================================*/
/* Table: resources_question_snapshot                           */
/*==============================================================*/
create table resources_question_snapshot
(
    resources_question_snapshot_id char(10) comment '题目快照ID',
    from_id              bigint unsigned not null auto_increment comment '来源ID',
    from_type            char(10) comment '来源类型（HOMEWORK...）',
    course_info_id       bigint comment '课程ID',
    question_type        int(2) comment '题型(1单选 2多选 3判断)',
    question_score       decimal(3,1) comment '分值',
    question_stem        varchar(3000) comment '题干',
    question_option_a    varchar(1000) comment '选项A',
    question_option_b    varchar(1000) comment '选项B',
    question_option_c    varchar(1000) comment '选项C',
    question_option_d    varchar(1000) comment '选项D',
    question_option_e    varchar(1000) comment '选项E',
    question_answer      varchar(255) comment '答案（单选是一个 多选是多个 判断是对错）',
    question_analysis    varchar(3000) comment '解析',
    question_status      int(2) comment '题目状态 （1上架， 0下架）',
    user_id              bigint comment '后台用户ID',
    org_id               bigint comment '组织机构ID',
    primary key (from_id)
)
    auto_increment = 1
    ENGINE = InnoDB
    DEFAULT CHARACTER SET = utf8
    COLLATE = utf8_general_ci;

alter table resources_question_snapshot comment '资源管理 - 题库管理-快照-关联来源';

ALTER TABLE hands_on ADD  COLUMN add_time datetime COMMENT '添加时间';
ALTER TABLE hands_on ADD  COLUMN org_id bigint(20) COMMENT '组织机构ID';
ALTER TABLE hands_on ADD  COLUMN user_id bigint(20) COMMENT '后台用户ID';
ALTER TABLE hands_on ADD  COLUMN training_data VARCHAR(1000) COMMENT '数据集（多个地址，逗号隔开）';
