Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 4 of 4 for autoupdatetime (0.09 sec)

  1. callbacks/update.go

    							value, isZero := field.ValueOf(stmt.Context, updatingValue)
    							if !stmt.SkipHooks && field.AutoUpdateTime > 0 {
    								if field.AutoUpdateTime == schema.UnixNanosecond {
    									value = stmt.DB.NowFunc().UnixNano()
    								} else if field.AutoUpdateTime == schema.UnixMillisecond {
    									value = stmt.DB.NowFunc().UnixMilli()
    Registered: Sun Nov 03 09:35:10 UTC 2024
    - Last Modified: Mon Mar 18 05:44:55 UTC 2024
    - 9.4K bytes
    - Viewed (0)
  2. callbacks/create.go

    							stmt.AddError(field.Set(stmt.Context, rv, field.DefaultValueInterface))
    						} else if field.AutoCreateTime > 0 || field.AutoUpdateTime > 0 {
    							stmt.AddError(field.Set(stmt.Context, rv, curTime))
    							values.Values[i][idx], _ = field.ValueOf(stmt.Context, rv)
    						}
    					} else if field.AutoUpdateTime > 0 && updateTrackTime {
    						stmt.AddError(field.Set(stmt.Context, rv, curTime))
    Registered: Sun Nov 03 09:35:10 UTC 2024
    - Last Modified: Mon Apr 08 03:29:55 UTC 2024
    - 12.5K bytes
    - Viewed (0)
  3. schema/field.go

    		}
    	}
    
    	if v, ok := field.TagSettings["AUTOUPDATETIME"]; (ok && utils.CheckTruth(v)) || (!ok && field.Name == "UpdatedAt" && (field.DataType == Time || field.DataType == Int || field.DataType == Uint)) {
    		if field.DataType == Time {
    			field.AutoUpdateTime = UnixTime
    		} else if strings.ToUpper(v) == "NANO" {
    			field.AutoUpdateTime = UnixNanosecond
    		} else if strings.ToUpper(v) == "MILLI" {
    Registered: Sun Nov 03 09:35:10 UTC 2024
    - Last Modified: Mon Apr 15 03:20:20 UTC 2024
    - 32K bytes
    - Viewed (0)
  4. tests/customize_field_test.go

    		AutoUnixCreateTime      int32  `gorm:"autocreatetime"`
    		AutoUnixMilliCreateTime int    `gorm:"autocreatetime:milli"`
    		AutoUnixNanoCreateTime  int64  `gorm:"autocreatetime:nano"`
    		AutoUnixUpdateTime      uint32 `gorm:"autoupdatetime"`
    		AutoUnixMilliUpdateTime int    `gorm:"autoupdatetime:milli"`
    		AutoUnixNanoUpdateTime  uint64 `gorm:"autoupdatetime:nano"`
    	}
    
    	DB.Migrator().DropTable(&CustomizeFieldStruct{})
    
    Registered: Sun Nov 03 09:35:10 UTC 2024
    - Last Modified: Fri Sep 11 09:33:31 UTC 2020
    - 6.9K bytes
    - Viewed (0)
Back to top