SET NAMES utf8mb4;
SET FOREIGN_KEY_CHECKS = 0;

-- ----------------------------
-- Table structure for core_job
-- ----------------------------
CREATE TABLE `core_job`
(
    `id`          varchar(50) NOT NULL,
    `create_time` datetime    NOT NULL,
    `update_time` datetime    NOT NULL,
    `is_deleted`  int(6)      NOT NULL DEFAULT '0',
    `name`        varchar(255)         DEFAULT NULL COMMENT '名称',
    `remark`      varchar(500)         DEFAULT NULL COMMENT '其他说明',
    `is_system`   int(6)      NOT NULL DEFAULT '0' COMMENT '是否系统',
    PRIMARY KEY (`id`)
) ENGINE = InnoDB
  DEFAULT CHARSET = utf8mb4 COMMENT ='职位';

-- ----------------------------
-- Table structure for core_job_func
-- ----------------------------
CREATE TABLE `core_job_func`
(
    `id`          varchar(50) NOT NULL,
    `create_time` datetime    NOT NULL,
    `update_time` datetime    NOT NULL,
    `is_deleted`  int(6)      NOT NULL DEFAULT '0',
    `job_id`      varchar(50)          DEFAULT NULL COMMENT '职位id',
    `point_id`    varchar(50)          DEFAULT NULL COMMENT ' 功能点id',
    PRIMARY KEY (`id`)
) ENGINE = InnoDB
  DEFAULT CHARSET = utf8mb4 COMMENT ='职位-功能关系';

-- ----------------------------
-- Table structure for core_job_user
-- ----------------------------
CREATE TABLE `core_job_user`
(
    `id`          varchar(50) NOT NULL,
    `create_time` datetime    NOT NULL,
    `update_time` datetime    NOT NULL,
    `is_deleted`  int(6)      NOT NULL DEFAULT '0',
    `user_id`     varchar(50) NOT NULL COMMENT '用户id',
    `job_id`      varchar(50) NOT NULL COMMENT '用户',
    PRIMARY KEY (`id`)
) ENGINE = InnoDB
  DEFAULT CHARSET = utf8mb4 COMMENT ='职位-用户';

-- ----------------------------
-- Table change for core_job_user
-- ----------------------------

alter table core_job_user
    add ext1 varchar(255) null comment '扩展1';

alter table core_job_user
    add ext2 varchar(255) null comment '扩展2';

alter table core_job_user
    add ext3 varchar(500) null comment '扩展3';

alter table core_job_user
    add ext_text text null comment '扩展文本';

alter table core_job_func
    change point_id func_id varchar(50) DEFAULT NULL COMMENT ' 功能点id';

SET FOREIGN_KEY_CHECKS = 1;
