feat: add index on categories.name and categories.parent_id (#658)

* Add Index on categories.name

* Add Index on categories.name and categories.parent_id
pull/662/head
wtune 2020-03-14 19:10:32 +08:00 committed by GitHub
parent 124f352ebb
commit c1f01df394
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 1 deletions

View File

@ -16,7 +16,9 @@ import javax.persistence.*;
*/ */
@Data @Data
@Entity @Entity
@Table(name = "categories") @Table(name = "categories",
indexes = {@Index(name = "categories_name", columnList = "name"),
@Index(name = "categories_parent_id", columnList = "parent_id")})
@ToString @ToString
@EqualsAndHashCode(callSuper = true) @EqualsAndHashCode(callSuper = true)
public class Category extends BaseEntity { public class Category extends BaseEntity {