feat: complete settings
This commit is contained in:
+1
-2
@@ -47,7 +47,7 @@ func Setup() {
|
||||
return setting.DatabaseSetting.TablePrefix + defaultTableName
|
||||
}
|
||||
|
||||
db.LogMode(true)
|
||||
//db.LogMode(true)
|
||||
db.SingularTable(true)
|
||||
db.Callback().Create().Replace("gorm:update_time_stamp", updateTimeStampForCreateCallback)
|
||||
db.Callback().Update().Replace("gorm:update_time_stamp", updateTimeStampForUpdateCallback)
|
||||
@@ -65,7 +65,6 @@ func CloseDB() {
|
||||
func updateTimeStampForCreateCallback(scope *gorm.Scope) {
|
||||
if !scope.HasError() {
|
||||
nowTime := time.Now()
|
||||
fmt.Printf("fyyyyyynowTime %s", nowTime)
|
||||
|
||||
if createTimeField, ok := scope.FieldByName("CreatedOn"); ok {
|
||||
if createTimeField.IsBlank {
|
||||
|
||||
Reference in New Issue
Block a user