/*

Navicat Premium Data Transfer

  

Source Server : local

Source Server Type : MySQL

Source Server Version : 50741 (5.7.41)

Source Host : localhost:3306

Source Schema : basic

  

Target Server Type : MySQL

Target Server Version : 50741 (5.7.41)

File Encoding : 65001

  

Date: 23/10/2023 10:35:20

*/

  

SET NAMES utf8mb4;

SET FOREIGN_KEY_CHECKS = 0;

  

-- ----------------------------

-- Table structure for t_menu

-- ----------------------------

DROP TABLE IF EXISTS `t_menu`;

CREATE TABLE `t_menu` (

`id` bigint(20) NOT NULL AUTO_INCREMENT,

`pid` bigint(20) DEFAULT '0' COMMENT '父ID',

`name` varchar(48) COLLATE utf8mb4_bin NOT NULL COMMENT '菜单名称',

`url` varchar(255) COLLATE utf8mb4_bin DEFAULT NULL COMMENT '链接',

`img` varchar(255) COLLATE utf8mb4_bin DEFAULT NULL COMMENT '图标',

`status_cd` tinyint(4) NOT NULL DEFAULT '1' COMMENT '状态 0-禁用 1-启用',

`type_cd` tinyint(4) DEFAULT '0' COMMENT '类型 0-父菜单 1-子菜单 2-功能',

`delete_cd` tinyint(4) NOT NULL DEFAULT '0' COMMENT '删除标记 0-正常 1-删除',

`create_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',

`update_time` datetime NOT NULL ON UPDATE CURRENT_TIMESTAMP COMMENT '修改时间',

PRIMARY KEY (`id`),

KEY `idx_pid` (`pid`)

) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin COMMENT='菜单表';

  

-- ----------------------------

-- Table structure for t_role_exclude

-- ----------------------------

DROP TABLE IF EXISTS `t_role_exclude`;

CREATE TABLE `t_role_exclude` (

`id` bigint(20) NOT NULL AUTO_INCREMENT,

`rid` bigint(20) NOT NULL COMMENT '角色ID',

`ex_rid` bigint(20) NOT NULL COMMENT '互斥角色ID',

`create_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,

PRIMARY KEY (`id`),

KEY `idx_rid` (`rid`),

KEY `idx_ex_rid` (`ex_rid`)

) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin COMMENT='角色互斥表';

  

-- ----------------------------

-- Table structure for t_role_group_detail

-- ----------------------------

DROP TABLE IF EXISTS `t_role_group_detail`;

CREATE TABLE `t_role_group_detail` (

`id` bigint(20) NOT NULL AUTO_INCREMENT,

`gid` bigint(20) NOT NULL COMMENT '角色组ID',

`rid` bigint(20) NOT NULL COMMENT '角色ID',

`create_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,

PRIMARY KEY (`id`),

KEY `idx_gid` (`gid`),

KEY `idx_rid` (`rid`)

) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin COMMENT='角色组明细表';

  

-- ----------------------------

-- Table structure for t_role_group_permission

-- ----------------------------

DROP TABLE IF EXISTS `t_role_group_permission`;

CREATE TABLE `t_role_group_permission` (

`id` bigint(20) NOT NULL AUTO_INCREMENT,

`gid` bigint(20) NOT NULL COMMENT '角色组ID',

`mid` bigint(20) NOT NULL COMMENT '菜单ID',

`create_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,

PRIMARY KEY (`id`) USING BTREE,

KEY `idx_gid` (`gid`),

KEY `idx_mid` (`mid`)

) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin COMMENT='角色组权限表';

  

-- ----------------------------

-- Table structure for t_role_groups

-- ----------------------------

DROP TABLE IF EXISTS `t_role_groups`;

CREATE TABLE `t_role_groups` (

`id` bigint(20) NOT NULL AUTO_INCREMENT,

`name` varchar(48) COLLATE utf8mb4_bin NOT NULL COMMENT '角色组名称',

`status_cd` tinyint(4) NOT NULL DEFAULT '1' COMMENT '状态 0-禁用 1-启用',

`delete_cd` tinyint(4) NOT NULL DEFAULT '0' COMMENT '删除标志 0-正常 1-删除',

`create_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,

PRIMARY KEY (`id`)

) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin COMMENT='角色组表';

  

-- ----------------------------

-- Table structure for t_role_permission

-- ----------------------------

DROP TABLE IF EXISTS `t_role_permission`;

CREATE TABLE `t_role_permission` (

`id` bigint(20) NOT NULL AUTO_INCREMENT,

`rid` bigint(20) NOT NULL COMMENT '角色ID',

`mid` bigint(20) NOT NULL COMMENT '菜单ID',

`create_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,

PRIMARY KEY (`id`) USING BTREE

) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin COMMENT='角色权限表';

  

-- ----------------------------

-- Table structure for t_role_tree

-- ----------------------------

DROP TABLE IF EXISTS `t_role_tree`;

CREATE TABLE `t_role_tree` (

`id` bigint(20) NOT NULL AUTO_INCREMENT,

`parent_id` bigint(20) DEFAULT NULL COMMENT '角色父ID',

`child_id` bigint(20) DEFAULT NULL COMMENT '角色子ID',

`create_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,

PRIMARY KEY (`id`)

) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin COMMENT='角色继承表';

  

-- ----------------------------

-- Table structure for t_roles

-- ----------------------------

DROP TABLE IF EXISTS `t_roles`;

CREATE TABLE `t_roles` (

`id` bigint(20) NOT NULL AUTO_INCREMENT,

`name` varchar(48) COLLATE utf8mb4_bin NOT NULL COMMENT '角色名称',

`status_cd` tinyint(4) NOT NULL DEFAULT '1' COMMENT '状态 0-禁用 1-启用',

`delete_cd` tinyint(4) NOT NULL DEFAULT '0' COMMENT '删除标志 0-正常 1-删除',

`create_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,

PRIMARY KEY (`id`)

) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin COMMENT='角色表';

  

-- ----------------------------

-- Table structure for t_user_permission

-- ----------------------------

DROP TABLE IF EXISTS `t_user_permission`;

CREATE TABLE `t_user_permission` (

`id` bigint(20) NOT NULL AUTO_INCREMENT,

`uid` bigint(20) NOT NULL COMMENT '用户ID',

`mid` bigint(20) NOT NULL COMMENT '菜单ID',

`create_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,

PRIMARY KEY (`id`)

) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin COMMENT='用户权限表';

  

-- ----------------------------

-- Table structure for t_user_role_groups

-- ----------------------------

DROP TABLE IF EXISTS `t_user_role_groups`;

CREATE TABLE `t_user_role_groups` (

`id` bigint(20) NOT NULL AUTO_INCREMENT,

`uid` bigint(20) NOT NULL COMMENT '用户ID',

`gid` bigint(20) NOT NULL COMMENT '角色组ID',

`create_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,

PRIMARY KEY (`id`)

) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin COMMENT='用户角色组表';

  

-- ----------------------------

-- Table structure for t_user_roles

-- ----------------------------

DROP TABLE IF EXISTS `t_user_roles`;

CREATE TABLE `t_user_roles` (

`id` bigint(20) NOT NULL AUTO_INCREMENT,

`uid` bigint(20) NOT NULL COMMENT '用户ID',

`rid` bigint(20) NOT NULL COMMENT '角色ID',

`create_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,

PRIMARY KEY (`id`)

) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin COMMENT='用户角色表';

  

-- ----------------------------

-- Table structure for t_users

-- ----------------------------

DROP TABLE IF EXISTS `t_users`;

CREATE TABLE `t_users` (

`id` bigint(20) NOT NULL AUTO_INCREMENT,

`name` varchar(48) COLLATE utf8mb4_bin NOT NULL COMMENT '昵称',

`img` varchar(255) COLLATE utf8mb4_bin DEFAULT NULL COMMENT '图标',

`username` varchar(48) COLLATE utf8mb4_bin NOT NULL COMMENT '用户名',

`password` varchar(128) COLLATE utf8mb4_bin NOT NULL COMMENT '密码',

`status_cd` tinyint(4) NOT NULL DEFAULT '1' COMMENT '状态 0-禁用 1-启用',

`delete_cd` tinyint(4) NOT NULL DEFAULT '0' COMMENT '删除标志 0-正常 1-删除',

`create_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',

`update_time` datetime NOT NULL ON UPDATE CURRENT_TIMESTAMP COMMENT '修改时间',

PRIMARY KEY (`id`)

) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin COMMENT='用户表';

  

SET FOREIGN_KEY_CHECKS = 1;