mirror of
https://github.com/nezhahq/nezha.git
synced 2025-01-22 20:58:14 -05:00
gorm: CreatedAt index
This commit is contained in:
parent
011fc2340a
commit
51655a09a1
@ -1,8 +1,9 @@
|
|||||||
package model
|
package model
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"gorm.io/gorm"
|
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
|
"gorm.io/gorm"
|
||||||
)
|
)
|
||||||
|
|
||||||
const CtxKeyAuthorizedUser = "ckau"
|
const CtxKeyAuthorizedUser = "ckau"
|
||||||
@ -11,7 +12,7 @@ const CacheKeyOauth2State = "p:a:state"
|
|||||||
|
|
||||||
type Common struct {
|
type Common struct {
|
||||||
ID uint64 `gorm:"primaryKey"`
|
ID uint64 `gorm:"primaryKey"`
|
||||||
CreatedAt time.Time `gorm:"<-:create"`
|
CreatedAt time.Time `gorm:"index;<-:create"`
|
||||||
UpdatedAt time.Time `gorm:"autoUpdateTime"`
|
UpdatedAt time.Time `gorm:"autoUpdateTime"`
|
||||||
DeletedAt gorm.DeletedAt `gorm:"index"`
|
DeletedAt gorm.DeletedAt `gorm:"index"`
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user