mirror of https://github.com/go-gorm/gorm.git
Fix migrator GuessConstraintAndTable method for return value for *schema.Check (#4527)
This commit is contained in:
parent
413fe587c6
commit
9e5a4e30b4
|
@ -503,9 +503,10 @@ func (m Migrator) GuessConstraintAndTable(stmt *gorm.Statement, name string) (_
|
|||
}
|
||||
|
||||
if field := stmt.Schema.LookUpField(name); field != nil {
|
||||
for _, cc := range checkConstraints {
|
||||
if cc.Field == field {
|
||||
return nil, &cc, stmt.Table
|
||||
for k := range checkConstraints {
|
||||
if checkConstraints[k].Field == field {
|
||||
v := checkConstraints[k]
|
||||
return nil, &v, stmt.Table
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue