fix: For time type, the time field will be automatically updated. Even if the table structure is not changed, the table modification operation will be repeated.
This commit is contained in:
		
							parent
							
								
									f482f25c71
								
							
						
					
					
						commit
						6c19f3ac0f
					
				| @ -543,7 +543,7 @@ func (m Migrator) MigrateColumn(value interface{}, field *schema.Field, columnTy | ||||
| 		} else if currentDefaultNotNull || dvNotNull { | ||||
| 			switch field.GORMDataType { | ||||
| 			case schema.Time: | ||||
| 				if !strings.EqualFold(strings.TrimSuffix(dv, "()"), strings.TrimSuffix(field.DefaultValue, "()")) { | ||||
| 				if !strings.EqualFold(strings.Split(dv, "(")[0], strings.Split(field.DefaultValue, "(")[0]) { | ||||
| 					alterColumn = true | ||||
| 				} | ||||
| 			case schema.Bool: | ||||
|  | ||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user
	 jm
						jm