mirror of https://github.com/halo-dev/halo
feat: add Index on comments.(type,status) and comments.parent_id (#686)
parent
9ccd23d730
commit
03a43fb245
|
@ -19,7 +19,10 @@ import javax.persistence.*;
|
|||
*/
|
||||
@Data
|
||||
@Entity(name = "BaseComment")
|
||||
@Table(name = "comments", indexes = {@Index(name = "comments_post_id", columnList = "post_id")})
|
||||
@Table(name = "comments",
|
||||
indexes = {@Index(name = "comments_post_id", columnList = "post_id"),
|
||||
@Index(name = "comments_type_status", columnList = "type, status"),
|
||||
@Index(name = "comments_parent_id", columnList = "parent_id")})
|
||||
@DiscriminatorColumn(name = "type", discriminatorType = DiscriminatorType.INTEGER, columnDefinition = "int default 0")
|
||||
@ToString(callSuper = true)
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
|
|
Loading…
Reference in New Issue