Add index on role.level

pull/314/head
wtune 2020-03-20 19:12:28 +08:00
parent da006624a4
commit e4e6edcc8d
2 changed files with 4 additions and 2 deletions

View File

@ -18,7 +18,8 @@ import java.util.Set;
* @date 2018-11-22
*/
@Entity
@Table(name = "role")
@Table(name = "role",
indexes = {@Index(name = "role_level", columnList = "level")})
@Getter
@Setter
public class Role implements Serializable {

View File

@ -605,7 +605,8 @@ CREATE TABLE `role` (
`level` int(255) NULL DEFAULT NULL COMMENT '角色级别',
`create_time` datetime NULL DEFAULT NULL COMMENT '创建日期',
`permission` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '功能权限',
PRIMARY KEY (`id`) USING BTREE
PRIMARY KEY (`id`) USING BTREE,
KEY `role_level` (`level`)
) ENGINE = InnoDB AUTO_INCREMENT = 3 CHARACTER SET = utf8 COLLATE = utf8_general_ci COMMENT = '角色表' ROW_FORMAT = Compact;
-- ----------------------------