You can not select more than 25 topics Topics must start with a chinese character,a letter or number, can include dashes ('-') and can be up to 35 characters long.

shiro.sql 3.8 kB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101
  1. /*
  2. Navicat Premium Data Transfer
  3. Source Server : 本机
  4. Source Server Type : MySQL
  5. Source Server Version : 50718
  6. Source Host : localhost:3306
  7. Source Schema : spring-boot-demo
  8. Target Server Type : MySQL
  9. Target Server Version : 50718
  10. File Encoding : 65001
  11. Date: 12/12/2018 18:52:51
  12. */
  13. SET NAMES utf8mb4;
  14. SET FOREIGN_KEY_CHECKS = 0;
  15. -- ----------------------------
  16. -- Table structure for sec_user
  17. -- ----------------------------
  18. DROP TABLE IF EXISTS `shiro_user`;
  19. CREATE TABLE `shiro_user`
  20. (
  21. `id` bigint(64) NOT NULL COMMENT '主键',
  22. `username` varchar(50) NOT NULL COMMENT '用户名',
  23. `password` varchar(60) NOT NULL COMMENT '密码',
  24. `salt` varchar(60) NOT NULL COMMENT '盐值',
  25. `nickname` varchar(255) DEFAULT NULL COMMENT '昵称',
  26. `phone` varchar(11) DEFAULT NULL COMMENT '手机',
  27. `email` varchar(50) DEFAULT NULL COMMENT '邮箱',
  28. `birthday` bigint(13) DEFAULT NULL COMMENT '生日',
  29. `sex` int(2) DEFAULT NULL COMMENT '性别,男-1,女-2',
  30. `status` int(2) NOT NULL DEFAULT '1' COMMENT '状态,启用-1,禁用-0',
  31. `create_time` bigint(13) NOT NULL COMMENT '创建时间',
  32. `update_time` bigint(13) NOT NULL COMMENT '更新时间',
  33. PRIMARY KEY (`id`),
  34. UNIQUE KEY `username` (`username`),
  35. UNIQUE KEY `phone` (`phone`),
  36. UNIQUE KEY `email` (`email`)
  37. ) ENGINE = InnoDB
  38. DEFAULT CHARSET = utf8 COMMENT ='用户表';
  39. -- ----------------------------
  40. -- Table structure for sec_role
  41. -- ----------------------------
  42. DROP TABLE IF EXISTS `shiro_role`;
  43. CREATE TABLE `shiro_role`
  44. (
  45. `id` bigint(64) NOT NULL COMMENT '主键',
  46. `name` varchar(50) NOT NULL COMMENT '角色名',
  47. `description` varchar(100) DEFAULT NULL COMMENT '描述',
  48. `create_time` bigint(13) NOT NULL COMMENT '创建时间',
  49. `update_time` bigint(13) NOT NULL COMMENT '更新时间',
  50. PRIMARY KEY (`id`),
  51. UNIQUE KEY `name` (`name`)
  52. ) ENGINE = InnoDB
  53. DEFAULT CHARSET = utf8 COMMENT ='角色表';
  54. -- ----------------------------
  55. -- Table structure for sec_user_role
  56. -- ----------------------------
  57. DROP TABLE IF EXISTS `shiro_user_role`;
  58. CREATE TABLE `shiro_user_role`
  59. (
  60. `user_id` bigint(64) NOT NULL COMMENT '用户主键',
  61. `role_id` bigint(64) NOT NULL COMMENT '角色主键',
  62. PRIMARY KEY (`user_id`, `role_id`)
  63. ) ENGINE = InnoDB
  64. DEFAULT CHARSET = utf8 COMMENT ='用户角色关系表';
  65. -- ----------------------------
  66. -- Table structure for sec_permission
  67. -- ----------------------------
  68. DROP TABLE IF EXISTS `shiro_permission`;
  69. CREATE TABLE `shiro_permission`
  70. (
  71. `id` bigint(64) NOT NULL COMMENT '主键',
  72. `name` varchar(50) NOT NULL COMMENT '权限名',
  73. `url` varchar(1000) DEFAULT NULL COMMENT '类型为页面时,代表前端路由地址,类型为按钮时,代表后端接口地址',
  74. `type` int(2) NOT NULL COMMENT '权限类型,页面-1,按钮-2',
  75. `permission` varchar(50) DEFAULT NULL COMMENT '权限表达式',
  76. `method` varchar(50) DEFAULT NULL COMMENT '后端接口访问方式',
  77. `sort` int(11) NOT NULL COMMENT '排序',
  78. `parent_id` bigint(64) NOT NULL COMMENT '父级id',
  79. PRIMARY KEY (`id`)
  80. ) ENGINE = InnoDB
  81. DEFAULT CHARSET = utf8 COMMENT ='权限表';
  82. -- ----------------------------
  83. -- Table structure for sec_role_permission
  84. -- ----------------------------
  85. DROP TABLE IF EXISTS `shiro_role_permission`;
  86. CREATE TABLE `shiro_role_permission`
  87. (
  88. `role_id` bigint(64) NOT NULL COMMENT '角色主键',
  89. `permission_id` bigint(64) NOT NULL COMMENT '权限主键',
  90. PRIMARY KEY (`role_id`, `permission_id`)
  91. ) ENGINE = InnoDB
  92. DEFAULT CHARSET = utf8 COMMENT ='角色权限关系表';