From f8d7737723620a4ed1e48aeb0298a5d4a7e35479 Mon Sep 17 00:00:00 2001 From: zhaoxiaorong Date: Fri, 25 Jul 2025 15:10:59 +0800 Subject: [PATCH] fix --- types/db.go | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/types/db.go b/types/db.go index b550511..e520546 100644 --- a/types/db.go +++ b/types/db.go @@ -28,9 +28,9 @@ type ( Std_IICUDS struct { ID uint `gorm:"column:id;primarykey;" json:"id"` Identity string `gorm:"column:identity;type:varchar(36);uniqueIndex;" json:"identity"` // 唯一标识,24位NanoID,36位为ULID - CreatedAt time.Time `gorm:"column:created_at;" json:"created_at"` - UpdatedAt time.Time `gorm:"column:updated_at;" json:"updated_at"` - DeletedAt gorm.DeletedAt `gorm:"column:deleted_at;index;" json:"deleted_at"` + CreatedAt time.Time `gorm:"column:created_at;type:TIMESTAMP;" json:"created_at"` + UpdatedAt time.Time `gorm:"column:updated_at;type:TIMESTAMP;" json:"updated_at"` + DeletedAt gorm.DeletedAt `gorm:"column:deleted_at;type:TIMESTAMP;index;" json:"deleted_at"` Status int8 `gorm:"column:status;default:0;index;" json:"status"` // 状态:默认为0,-1禁止,1为正常 } @@ -38,14 +38,14 @@ type ( Std_ICUD struct { ID uint `gorm:"column:id;primarykey;" json:"id"` CreatedAt time.Time `gorm:"column:created_at;" json:"created_at"` - UpdatedAt time.Time `gorm:"column:updated_at;" json:"updated_at"` - DeletedAt gorm.DeletedAt `gorm:"column:deleted_at;index;" json:"deleted_at"` + UpdatedAt time.Time `gorm:"column:updated_at;type:TIMESTAMP;" json:"updated_at"` + DeletedAt gorm.DeletedAt `gorm:"column:deleted_at;type:TIMESTAMP;index;" json:"deleted_at"` } // standard ID,Created definition. Std_IdCreated struct { ID uint `gorm:"column:id;primarykey;" json:"id"` - CreatedAt time.Time `gorm:"column:created_at;" json:"created_at"` + CreatedAt time.Time `gorm:"column:created_at;type:TIMESTAMP;" json:"created_at"` } // standard PassportID,PassportIdentity definition.