migrator.go -> MigrateColumn.
// check unique, if column has "uniqueIndex" tag, it's unique = true.
This commit is contained in:
		
							parent
							
								
									2c13ea008e
								
							
						
					
					
						commit
						286e4ea884
					
				@ -440,7 +440,7 @@ func (m Migrator) MigrateColumn(value interface{}, field *schema.Field, columnTy
 | 
				
			|||||||
	}
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	// check unique
 | 
						// check unique
 | 
				
			||||||
	if unique, ok := columnType.Unique(); ok && unique != field.Unique {
 | 
						if unique, ok := columnType.Unique(); ok && !(unique == field.Unique || field.UniqueIndex == unique) {
 | 
				
			||||||
		// not primary key
 | 
							// not primary key
 | 
				
			||||||
		if !field.PrimaryKey {
 | 
							if !field.PrimaryKey {
 | 
				
			||||||
			alterColumn = true
 | 
								alterColumn = true
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user