Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 4 of 4 for autoupdatetime (0.22 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()
    Go
    - Registered: Sun Apr 28 09:35:09 GMT 2024
    - Last Modified: Mon Mar 18 05:44:55 GMT 2024
    - 9.4K bytes
    - Viewed (1)
  2. 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" {
    Go
    - Registered: Sun Apr 28 09:35:09 GMT 2024
    - Last Modified: Mon Apr 15 03:20:20 GMT 2024
    - 32K bytes
    - Viewed (1)
  3. 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))
    Go
    - Registered: Sun Apr 28 09:35:09 GMT 2024
    - Last Modified: Mon Apr 08 03:29:55 GMT 2024
    - 12.5K bytes
    - Viewed (0)
  4. tests/customize_field_test.go

    		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{})
    
    	if err := DB.AutoMigrate(&CustomizeFieldStruct{}); err != nil {
    Go
    - Registered: Sun Apr 28 09:35:09 GMT 2024
    - Last Modified: Fri Sep 11 09:33:31 GMT 2020
    - 6.9K bytes
    - Viewed (0)
Back to top