Remove redundant percision check for migrator
extra checking can cause "tag:percision" to lose meaning
This commit is contained in:
		
							parent
							
								
									e5bdd610c3
								
							
						
					
					
						commit
						52103dd623
					
				@ -407,9 +407,7 @@ func (m Migrator) MigrateColumn(value interface{}, field *schema.Field, columnTy
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
	// check precision
 | 
						// check precision
 | 
				
			||||||
	if precision, _, ok := columnType.DecimalSize(); ok && int64(field.Precision) != precision {
 | 
						if precision, _, ok := columnType.DecimalSize(); ok && int64(field.Precision) != precision {
 | 
				
			||||||
		if regexp.MustCompile(fmt.Sprintf("[^0-9]%d[^0-9]", field.Precision)).MatchString(m.DataTypeOf(field)) {
 | 
							alterColumn = true
 | 
				
			||||||
			alterColumn = true
 | 
					 | 
				
			||||||
		}
 | 
					 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	// check nullable
 | 
						// check nullable
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user