text: /*
   Navicat Premium Data Transfer
  */
  
  SET NAMES utf8mb4;
  SET FOREIGN_KEY_CHECKS = 0;
  
  -- ----------------------------
  -- Table structure for admin_auth_access
  -- ----------------------------
  DROP TABLE IF EXISTS `admin_auth_access`;
  CREATE TABLE `admin_auth_access` (
    `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
    `role_id` int(10) unsigned NOT NULL COMMENT '角色',
    `rule_name` varchar(100) NOT NULL DEFAULT '' COMMENT '规则唯一英文标识,全小写',
    `type` varchar(30) NOT NULL DEFAULT '' COMMENT '权限规则分类,请加应用前缀,如admin_',
    PRIMARY KEY (`id`),
    KEY `role_id` (`role_id`),
    KEY `rule_name` (`rule_name`) USING BTREE
  ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='权限授权表';;
  
  -- ----------------------------
  -- Table structure for admin_auth_rule
  -- ----------------------------
  DROP TABLE IF EXISTS `admin_auth_rule`;
  CREATE TABLE `admin_auth_rule` (
    `id` int(10) unsigned NOT NULL AUTO_INCREMENT COMMENT '规则id,自增主键',
    `status` tinyint(3) unsigned NOT NULL DEFAULT '1' COMMENT '是否有效(0:无效,1:有效)',
    `app` varchar(40) NOT NULL DEFAULT '' COMMENT '规则所属app',
    `type` varchar(30) NOT NULL DEFAULT '' COMMENT '权限规则分类，请加应用前缀,如admin_',
    `name` varchar(100) NOT NULL DEFAULT '' COMMENT '规则唯一英文标识,全小写',
    `param` varchar(100) NOT NULL DEFAULT '' COMMENT '额外url参数',
    `title` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT '' COMMENT '规则描述',
    `condition` varchar(200) NOT NULL DEFAULT '' COMMENT '规则附加条件',
    PRIMARY KEY (`id`),
    UNIQUE KEY `name` (`name`) USING BTREE,
    KEY `module` (`app`,`status`,`type`)
  ) ENGINE=InnoDB AUTO_INCREMENT=93 DEFAULT CHARSET=utf8mb4 COMMENT='权限规则表';
  
  
  -- ----------------------------
  -- Table structure for admin_menu
  -- ----------------------------
  DROP TABLE IF EXISTS `admin_menu`;
  CREATE TABLE `admin_menu` (
    `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
    `parent_id` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '父菜单id',
    `type` tinyint(3) unsigned NOT NULL DEFAULT '1' COMMENT '菜单类型;1:有界面可访问菜单,2:无界面可访问菜单,0:只作为菜单',
    `status` tinyint(3) unsigned NOT NULL DEFAULT '0' COMMENT '状态;1:显示,0:不显示',
    `sort` float NOT NULL DEFAULT '10000' COMMENT '排序',
    `app` varchar(40) CHARACTER SET utf8 NOT NULL DEFAULT '' COMMENT '应用名',
    `controller` varchar(30) CHARACTER SET utf8 NOT NULL DEFAULT '' COMMENT '控制器名',
    `action` varchar(30) CHARACTER SET utf8 NOT NULL DEFAULT '' COMMENT '操作名称',
    `rule` varchar(100) DEFAULT NULL,
    `param` varchar(50) CHARACTER SET utf8 NOT NULL DEFAULT '' COMMENT '额外参数',
    `name` varchar(30) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT '' COMMENT '菜单名称',
    `icon` varchar(20) CHARACTER SET utf8 NOT NULL DEFAULT '' COMMENT '菜单图标',
    `remark` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT '' COMMENT '备注',
    `path` varchar(50) DEFAULT NULL COMMENT '前端页面',
    `component` varchar(50) DEFAULT NULL COMMENT '组件名',
    `code` varchar(30) DEFAULT 'default',
    PRIMARY KEY (`id`),
    UNIQUE KEY `unique_path` (`app`,`controller`,`action`),
    KEY `status` (`status`),
    KEY `parent_id` (`parent_id`),
    KEY `controller` (`controller`),
    KEY `code` (`code`)
  ) ENGINE=InnoDB AUTO_INCREMENT=491 DEFAULT CHARSET=utf8mb4 COMMENT='后台菜单表';
  
  
  -- ----------------------------
  -- Table structure for admin_menu_permission
  -- ----------------------------
  DROP TABLE IF EXISTS `admin_menu_permission`;
  CREATE TABLE `admin_menu_permission` (
    `id` smallint(5) unsigned NOT NULL AUTO_INCREMENT,
    `code` varchar(30) DEFAULT NULL,
    `name` varchar(50) DEFAULT NULL,
    PRIMARY KEY (`id`),
    UNIQUE KEY `code` (`code`)
  ) ENGINE=InnoDB AUTO_INCREMENT=17 DEFAULT CHARSET=utf8mb4 COMMENT='按钮权限分类';
  
  -- ----------------------------
  -- Records of admin_menu_permission
  -- ----------------------------
  BEGIN;
  INSERT INTO `admin_menu_permission` VALUES (1, 'query', '查看');
  INSERT INTO `admin_menu_permission` VALUES (2, 'add', '新增');
  INSERT INTO `admin_menu_permission` VALUES (3, 'edit', '编辑');
  INSERT INTO `admin_menu_permission` VALUES (4, 'upload', '上传');
  INSERT INTO `admin_menu_permission` VALUES (5, 'download', '下载');
  INSERT INTO `admin_menu_permission` VALUES (6, 'delete', '删除');
  INSERT INTO `admin_menu_permission` VALUES (7, 'export', '导出');
  INSERT INTO `admin_menu_permission` VALUES (8, 'import', '导入');
  INSERT INTO `admin_menu_permission` VALUES (9, 'check', '审核');
  INSERT INTO `admin_menu_permission` VALUES (10, 'uncheck', '反审');
  INSERT INTO `admin_menu_permission` VALUES (11, 'refuse', '拒绝');
  INSERT INTO `admin_menu_permission` VALUES (12, 'disable', '禁用');
  INSERT INTO `admin_menu_permission` VALUES (13, 'enable', '启用');
  INSERT INTO `admin_menu_permission` VALUES (16, 'toggle', '置反');
  COMMIT;
  
  -- ----------------------------
  -- Table structure for admin_role
  -- ----------------------------
  DROP TABLE IF EXISTS `admin_role`;
  CREATE TABLE `admin_role` (
    `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
    `parent_id` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '父角色ID',
    `status` tinyint(3) unsigned NOT NULL DEFAULT '0' COMMENT '状态;0:禁用;1:正常',
    `create_time` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '创建时间',
    `update_time` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '更新时间',
    `list_order` float NOT NULL DEFAULT '0' COMMENT '排序',
    `name` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT '' COMMENT '角色名称',
    `remark` varchar(255) NOT NULL DEFAULT '' COMMENT '备注',
    PRIMARY KEY (`id`),
    KEY `parent_id` (`parent_id`),
    KEY `status` (`status`)
  ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='角色表';
  
  -- ----------------------------
  -- Table structure for admin_role_user
  -- ----------------------------
  DROP TABLE IF EXISTS `admin_role_user`;
  CREATE TABLE `admin_role_user` (
    `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
    `role_id` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '角色 id',
    `user_id` bigint(20) unsigned NOT NULL DEFAULT '0' COMMENT '用户id',
    PRIMARY KEY (`id`),
    KEY `role_id` (`role_id`),
    KEY `user_id` (`user_id`)
  ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='用户角色对应表';
  
  SET FOREIGN_KEY_CHECKS = 1;
  