Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 3 of 3 for AutoUpdateTime (0.08 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)
Back to top