Skip to content

Commit

Permalink
fix: rename column only if the name does not exist in 'target'
Browse files Browse the repository at this point in the history
  • Loading branch information
bevzzz committed Oct 22, 2024
1 parent 4c8829d commit a68eae0
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion migrate/diff.go
Original file line number Diff line number Diff line change
Expand Up @@ -360,7 +360,7 @@ ChangedRenamed:
// Find renamed columns first.
for cName, cCol := range current.Columns {
// Cannot rename if a column with this name already exists or the types differ.
if _, exists := current.Columns[tName]; exists || !d.equalColumns(tCol, cCol) {
if _, exists := target.Columns[cName]; exists || !d.equalColumns(tCol, cCol) {
continue
}
d.changes.Add(&RenameColumn{
Expand Down

0 comments on commit a68eae0

Please sign in to comment.