1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275
|
SET NAMES utf8mb4; SET FOREIGN_KEY_CHECKS = 0;
DROP TABLE IF EXISTS `button`; CREATE TABLE `button` ( `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT, `name` varchar(30) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '按钮名称', `page_id` int(10) UNSIGNED NULL DEFAULT NULL COMMENT '页面id', PRIMARY KEY (`id`) USING BTREE ) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '页面操作按钮信息表' ROW_FORMAT = Dynamic;
DROP TABLE IF EXISTS `menu`; CREATE TABLE `menu` ( `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT, `name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '菜单名称', `path` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '请求路径', `link_type` tinyint(1) UNSIGNED NULL DEFAULT NULL COMMENT '0本网页打开1新网页打开', `description` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '描述', `parent_id` int(10) UNSIGNED NULL DEFAULT NULL COMMENT '父菜单', `page_id` int(10) UNSIGNED NULL DEFAULT NULL COMMENT '页面id', PRIMARY KEY (`id`) USING BTREE ) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '菜单信息表' ROW_FORMAT = Dynamic;
DROP TABLE IF EXISTS `page`; CREATE TABLE `page` ( `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT, `name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL, `description` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL, PRIMARY KEY (`id`) USING BTREE ) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '页面信息表' ROW_FORMAT = Dynamic;
DROP TABLE IF EXISTS `permission`; CREATE TABLE `permission` ( `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT, `name` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '权限名称', `code` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '权限代码', `created_time` datetime(0) NULL DEFAULT NULL COMMENT '创建时间', PRIMARY KEY (`id`) USING BTREE ) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci ROW_FORMAT = Dynamic;
DROP TABLE IF EXISTS `permission_buttion`; CREATE TABLE `permission_buttion` ( `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT, `permission_id` int(10) UNSIGNED NULL DEFAULT NULL COMMENT '权限id', `buttion_id` int(10) UNSIGNED NULL DEFAULT NULL COMMENT '按钮id', PRIMARY KEY (`id`) USING BTREE ) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci ROW_FORMAT = Dynamic;
DROP TABLE IF EXISTS `permission_group`; CREATE TABLE `permission_group` ( `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT, `name` varchar(30) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '分组名称', `description` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '分组描述', PRIMARY KEY (`id`) USING BTREE ) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '权限组信息表' ROW_FORMAT = Dynamic;
DROP TABLE IF EXISTS `permission_menu`; CREATE TABLE `permission_menu` ( `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT, `permission_id` int(10) UNSIGNED NULL DEFAULT NULL COMMENT '权限id', `menu_id` int(10) UNSIGNED NULL DEFAULT NULL COMMENT '菜单id', PRIMARY KEY (`id`) USING BTREE ) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '权限菜单信息表' ROW_FORMAT = Dynamic;
DROP TABLE IF EXISTS `role`; CREATE TABLE `role` ( `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT, `name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '角色名称,比如管理员', `code` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '角色代码,比如admin', `created_time` datetime(0) NULL DEFAULT NULL COMMENT '创建时间', `max_count` int(10) UNSIGNED NULL DEFAULT NULL COMMENT '该角色最多使用的人数', `use_count` int(10) UNSIGNED NULL DEFAULT NULL COMMENT '已使用的人数', PRIMARY KEY (`id`) USING BTREE ) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '角色信息表' ROW_FORMAT = Dynamic;
DROP TABLE IF EXISTS `role_exclusion_group`; CREATE TABLE `role_exclusion_group` ( `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT, `name` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '分组名称', `description` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '描述互斥的规则', PRIMARY KEY (`id`) USING BTREE ) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '互斥角色分组表' ROW_FORMAT = Dynamic;
DROP TABLE IF EXISTS `role_exclusion_group_item`; CREATE TABLE `role_exclusion_group_item` ( `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT, `group_id` int(10) UNSIGNED NULL DEFAULT NULL COMMENT '互斥分组id', `role_id` int(11) NULL DEFAULT NULL COMMENT '角色ID', `created_time` datetime(0) NULL DEFAULT NULL COMMENT '创建时间', PRIMARY KEY (`id`) USING BTREE ) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci ROW_FORMAT = Dynamic;
DROP TABLE IF EXISTS `role_extend`; CREATE TABLE `role_extend` ( `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT, `role_id` int(11) NULL DEFAULT NULL COMMENT '角色Id', `parent_id` int(10) UNSIGNED NULL DEFAULT NULL COMMENT '父角色Id', `created_time` datetime(0) NULL DEFAULT NULL COMMENT '创建时间', PRIMARY KEY (`id`) USING BTREE ) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '角色父类继承关系表' ROW_FORMAT = Dynamic;
DROP TABLE IF EXISTS `role_include_group`; CREATE TABLE `role_include_group` ( `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT, `role_id` int(10) UNSIGNED NULL DEFAULT NULL COMMENT '角色Id(该组是该角色的先决条件)', `name` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '分组名称', `type` tinyint(1) UNSIGNED NULL DEFAULT NULL COMMENT '先决项之间的逻辑关系0and ,1or', `description` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '描述', PRIMARY KEY (`id`) USING BTREE ) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '角色先决条件信息表' ROW_FORMAT = Dynamic;
DROP TABLE IF EXISTS `role_include_group_item`; CREATE TABLE `role_include_group_item` ( `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT, `group_id` int(10) UNSIGNED NULL DEFAULT NULL COMMENT '互斥分组id', `role_id` int(10) UNSIGNED NULL DEFAULT NULL COMMENT '角色ID', `created_time` datetime(0) NULL DEFAULT NULL COMMENT '创建时间', PRIMARY KEY (`id`) USING BTREE ) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '先决条件项信息表' ROW_FORMAT = Dynamic;
DROP TABLE IF EXISTS `role_merge_group`; CREATE TABLE `role_merge_group` ( `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT, `name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '合并后的权限名称', `code` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '合并后的权限代码', `created_time` datetime(0) NULL DEFAULT NULL COMMENT '创建时间', PRIMARY KEY (`id`) USING BTREE ) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci ROW_FORMAT = Dynamic;
DROP TABLE IF EXISTS `role_merge_group_item`; CREATE TABLE `role_merge_group_item` ( `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT, `role_id` int(10) UNSIGNED NULL DEFAULT NULL COMMENT '角色ID', `group_id` int(10) UNSIGNED NULL DEFAULT NULL COMMENT '合并分组id', `created_time` datetime(0) NULL DEFAULT NULL, PRIMARY KEY (`id`) USING BTREE ) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '角色合并项信息表' ROW_FORMAT = Dynamic;
DROP TABLE IF EXISTS `role_permission`; CREATE TABLE `role_permission` ( `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT, `role_id` int(10) UNSIGNED NULL DEFAULT NULL COMMENT '角色id', `permission_id` int(10) UNSIGNED NULL DEFAULT NULL COMMENT '权限id', `created_time` datetime(0) NULL DEFAULT NULL, PRIMARY KEY (`id`) USING BTREE ) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '角色权限关系信息表' ROW_FORMAT = Dynamic;
DROP TABLE IF EXISTS `roloe_group`; CREATE TABLE `roloe_group` ( `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT, `name` varchar(30) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '分组名称', `description` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '分组描述', PRIMARY KEY (`id`) USING BTREE ) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '角色组信息表' ROW_FORMAT = Dynamic;
DROP TABLE IF EXISTS `user`; CREATE TABLE `user` ( `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT, `username` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '登录名', `password` varchar(40) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '登录密码', `name` varchar(10) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '真实姓名', `sex` tinyint(1) UNSIGNED NULL DEFAULT NULL COMMENT '0未知 1男 2女', `old` int(2) UNSIGNED NULL DEFAULT NULL COMMENT '年龄', `created_time` datetime(0) NULL DEFAULT NULL COMMENT '创建时间', `last_login_time` datetime(0) NULL DEFAULT NULL COMMENT '最后一次登录时间', PRIMARY KEY (`id`) USING BTREE ) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '用户信息表' ROW_FORMAT = Dynamic;
DROP TABLE IF EXISTS `user_group`; CREATE TABLE `user_group` ( `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT, `name` varchar(30) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '分组名称', `parent_id` int(10) UNSIGNED NULL DEFAULT NULL COMMENT '父ID', `description` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '分组描述', PRIMARY KEY (`id`) USING BTREE ) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '部门信息表' ROW_FORMAT = Dynamic;
DROP TABLE IF EXISTS `user_role`; CREATE TABLE `user_role` ( `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT, `user_id` int(10) UNSIGNED NULL DEFAULT NULL COMMENT '用户id', `role_id` int(10) UNSIGNED NULL DEFAULT NULL COMMENT '角色id', `created_time` datetime(0) NULL DEFAULT NULL COMMENT '创建时间', PRIMARY KEY (`id`) USING BTREE ) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '用户角色关系表' ROW_FORMAT = Dynamic;
DROP TABLE IF EXISTS `user_role_group`; CREATE TABLE `user_role_group` ( `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT, `user_id` int(10) UNSIGNED NULL DEFAULT NULL COMMENT '用户id', `role_group_id` int(10) UNSIGNED NULL DEFAULT NULL COMMENT '角色id', `created_time` datetime(0) NULL DEFAULT NULL COMMENT '创建时间', PRIMARY KEY (`id`) USING BTREE ) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '用户角色组关系表' ROW_FORMAT = Dynamic;
SET FOREIGN_KEY_CHECKS = 1;
|