gorm: CreatedAt index
package model
import (
- "gorm.io/gorm"
"time"
+
+ "gorm.io/gorm"
)
const CtxKeyAuthorizedUser = "ckau"
@@ -11,7 +12,7 @@ const CacheKeyOauth2State = "p:a:state"
type Common struct {
ID uint64 `gorm:"primaryKey"`
- CreatedAt time.Time `gorm:"<-:create"`
+ CreatedAt time.Time `gorm:"index;<-:create"`
UpdatedAt time.Time `gorm:"autoUpdateTime"`
DeletedAt gorm.DeletedAt `gorm:"index"`
}
