rt-sim-training-service/sql/20221028-zhou-permission.sql

93 lines
7.4 KiB
MySQL
Raw Normal View History

2022-10-28 16:50:14 +08:00
SET NAMES utf8mb4;
SET FOREIGN_KEY_CHECKS = 0;
-- ----------------------------
-- Table structure for rts_permission
-- ----------------------------
DROP TABLE IF EXISTS `rts_permission`;
CREATE TABLE `rts_permission` (
`id` bigint NOT NULL AUTO_INCREMENT COMMENT '权限id,对功能(system_ability)的管理',
2022-12-07 14:13:54 +08:00
`project_code` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '对应的projectCode',
`map_id` bigint NULL DEFAULT NULL COMMENT '对应线路的mapId',
`permission_type` int NULL DEFAULT NULL COMMENT '权限类型 0=项目1=线路2=线路功能',
2022-10-28 16:50:14 +08:00
`name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '权限名称',
`des` varchar(512) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '权限描述',
`creator_id` bigint NULL DEFAULT NULL COMMENT '创建者id',
`create_time` datetime NULL DEFAULT NULL COMMENT '创建时间',
`update_time` datetime NULL DEFAULT NULL COMMENT '更新时间',
2022-12-07 14:13:54 +08:00
`is_sync` tinyint(1) NULL DEFAULT NULL COMMENT '是否同步的数据',
2022-10-28 16:50:14 +08:00
PRIMARY KEY (`id`) USING BTREE
2022-12-07 14:13:54 +08:00
) ENGINE = InnoDB AUTO_INCREMENT = 2159 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_0900_ai_ci ROW_FORMAT = Dynamic;
-- ----------------------------
-- Table structure for rts_permission_distribute
-- ----------------------------
DROP TABLE IF EXISTS `rts_permission_distribute`;
CREATE TABLE `rts_permission_distribute` (
`id` bigint NOT NULL AUTO_INCREMENT,
`map_id` bigint NULL DEFAULT NULL COMMENT '地图id',
`source_subject_id` bigint NULL DEFAULT NULL COMMENT '来源主体id',
`forever` tinyint(1) NULL DEFAULT NULL COMMENT '是否永久true/false',
`status` int NULL DEFAULT NULL COMMENT '权限分发状态,1-有效2-无效',
`create_time` datetime NULL DEFAULT NULL COMMENT '创建时间',
`update_time` datetime NULL DEFAULT NULL COMMENT '修改时间',
`start_time` datetime NULL DEFAULT NULL COMMENT '开始时间',
`end_time` datetime NULL DEFAULT NULL COMMENT '结束时间',
`creator_id` bigint NULL DEFAULT NULL COMMENT '创建者id',
`dsc` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '备注描述',
`is_sync` tinyint(1) NULL DEFAULT NULL COMMENT '是否同步的数据',
PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 4 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_0900_ai_ci ROW_FORMAT = Dynamic;
2022-10-28 16:50:14 +08:00
-- ----------------------------
-- Table structure for rts_permission_distribute_ref
-- ----------------------------
DROP TABLE IF EXISTS `rts_permission_distribute_ref`;
CREATE TABLE `rts_permission_distribute_ref` (
`id` bigint NOT NULL AUTO_INCREMENT,
`distribute_id` bigint NULL DEFAULT NULL COMMENT '分发id',
`permission_id` bigint NULL DEFAULT NULL COMMENT '权限id',
`amount` int NULL DEFAULT NULL COMMENT '总数量',
`remains` int NULL DEFAULT NULL COMMENT '剩余数量',
2022-12-07 14:13:54 +08:00
`is_sync` tinyint(1) NULL DEFAULT NULL COMMENT '是否同步数据',
2022-10-28 16:50:14 +08:00
PRIMARY KEY (`id`) USING BTREE
2022-12-07 14:13:54 +08:00
) ENGINE = InnoDB AUTO_INCREMENT = 8615 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_0900_ai_ci ROW_FORMAT = Dynamic;
2022-10-28 16:50:14 +08:00
-- ----------------------------
-- Table structure for rts_permission_subject
-- ----------------------------
DROP TABLE IF EXISTS `rts_permission_subject`;
CREATE TABLE `rts_permission_subject` (
`id` bigint NOT NULL AUTO_INCREMENT COMMENT '权限主体id',
`permission_id` bigint NULL DEFAULT NULL COMMENT '访问权限id',
`subject_type` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '主体类型(user,org)',
`subject_id` bigint NULL DEFAULT NULL COMMENT '主体id',
`amount` int NULL DEFAULT NULL COMMENT '主体对该权限的总数量',
`remains` int NULL DEFAULT NULL COMMENT '主体对该权限的剩余数量',
`status` int NULL DEFAULT NULL COMMENT '权限主体状态,1Valid-有效2InValid-无效',
`forever` tinyint(1) NULL DEFAULT NULL COMMENT '是否永久1-true/0-false',
`start_time` datetime NULL DEFAULT NULL COMMENT '开始时间',
`end_time` datetime NULL DEFAULT NULL COMMENT '结束时间',
`create_time` datetime NULL DEFAULT NULL COMMENT '创建时间',
`update_time` datetime NULL DEFAULT NULL COMMENT '更新时间',
2022-10-28 16:50:14 +08:00
`distribute_id` bigint NOT NULL COMMENT '来自对应的分发id(rts_permission_distribute)',
`parent_id` bigint NULL DEFAULT NULL COMMENT '父级id 数据来源rts_permission_distribute表source_subject_id字段',
2022-12-07 14:13:54 +08:00
`is_sync` tinyint(1) NULL DEFAULT NULL COMMENT '是否同步的数据',
2022-10-28 16:50:14 +08:00
PRIMARY KEY (`id`) USING BTREE
2022-12-07 14:13:54 +08:00
) ENGINE = InnoDB AUTO_INCREMENT = 60903 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_0900_ai_ci ROW_FORMAT = Dynamic;
2022-10-28 16:50:14 +08:00
-- ----------------------------
-- Table structure for rts_permission_system_ability
-- ----------------------------
DROP TABLE IF EXISTS `rts_permission_system_ability`;
CREATE TABLE `rts_permission_system_ability` (
`id` bigint NOT NULL AUTO_INCREMENT COMMENT '权限功能关联记录id',
`permission_id` bigint NULL DEFAULT NULL COMMENT '权限id',
`system_ability_id` bigint NULL DEFAULT NULL COMMENT '功能(system_ability)的id',
2022-12-07 14:13:54 +08:00
`is_sync` tinyint(1) NULL DEFAULT NULL COMMENT '是否同步的数据',
2022-10-28 16:50:14 +08:00
PRIMARY KEY (`id`) USING BTREE
2022-12-07 14:13:54 +08:00
) ENGINE = InnoDB AUTO_INCREMENT = 58719 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_0900_ai_ci ROW_FORMAT = Dynamic;
2022-10-28 16:50:14 +08:00
SET FOREIGN_KEY_CHECKS = 1;