feat: add Index on posts.(type,status) and posts.create_time (#684)

pull/688/head
wtune 2020-03-17 15:17:51 +08:00 committed by GitHub
parent 4bc8ad44da
commit 9ccd23d730
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 1 deletions

View File

@ -19,7 +19,9 @@ import java.util.Date;
*/
@Data
@Entity(name = "BasePost")
@Table(name = "posts")
@Table(name = "posts",
indexes = {@Index(name = "posts_type_status", columnList = "type, status"),
@Index(name = "posts_create_time", columnList = "create_time")})
@DiscriminatorColumn(name = "type", discriminatorType = DiscriminatorType.INTEGER, columnDefinition = "int default 0")
@ToString(callSuper = true)
@EqualsAndHashCode(callSuper = true)