Speed up user pagination query

This commit is contained in:
Yang Luo
2023-06-01 22:51:01 +08:00
parent 5349fa7ff3
commit b1b3184e75
3 changed files with 46 additions and 4 deletions

View File

@ -24,7 +24,8 @@ type Migrator_1_314_0_PR_1841 struct{}
func (*Migrator_1_314_0_PR_1841) IsMigrationNeeded() bool {
count, err := adapter.Engine.Where("password_type=?", "").Count(&User{})
if err != nil {
panic(err)
// table doesn't exist
return false
}
return count > 100