gorm: CreatedAt index
This commit is contained in:
		
							parent
							
								
									011fc2340a
								
							
						
					
					
						commit
						51655a09a1
					
				@ -1,8 +1,9 @@
 | 
			
		||||
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"`
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user