Skip to content

Commit

Permalink
Refactor Xun.ColumnAlt function to handle index and unique removal
Browse files Browse the repository at this point in the history
  • Loading branch information
trheyi committed May 24, 2024
1 parent 75e6dcb commit ba0bc25
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions schema/xun/xun.go
Original file line number Diff line number Diff line change
Expand Up @@ -229,12 +229,12 @@ func (x *Xun) ColumnAlt(name string, column types.Column) error {
sch := x.Manager.Schema()

// drop index
if column.RemoveIndex {
if column.RemoveIndex || column.Index {
x.IndexDel(name, fmt.Sprintf("%s_index", column.Name))
}

// drop unique
if column.RemoveUnique {
if column.RemoveUnique || column.Unique {
x.IndexDel(name, fmt.Sprintf("%s_unique", column.Name))
}

Expand Down

0 comments on commit ba0bc25

Please sign in to comment.