Skip to content

Commit

Permalink
fix dupls
Browse files Browse the repository at this point in the history
  • Loading branch information
covrom committed Aug 31, 2021
1 parent 5e978a5 commit 96cb891
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion schema/diff.go
Original file line number Diff line number Diff line change
Expand Up @@ -371,10 +371,21 @@ func (s *PatchSchema) Build(from, to *Schema) {
to: c,
}
tc, err := t.FindColumnByName(c.Name)
fnd := false
if err == nil {
pc.from = tc

for _, v := range pt.columns {
if v.from == pc.from &&
v.to == pc.to {
fnd = true
break
}
}
}
if !fnd {
pt.columns = append(pt.columns, pc)
}
pt.columns = append(pt.columns, pc)
}
}
for _, idx := range t.Indexes {
Expand Down

0 comments on commit 96cb891

Please sign in to comment.