mirror of
https://github.com/go-gitea/gitea.git
synced 2024-09-05 23:34:19 -04:00
Add check for empty set when dropping indexes during migration (#8475)
This commit is contained in:
parent
20a28b785a
commit
80b50afe1f
@ -384,11 +384,13 @@ func dropTableColumns(sess *xorm.Session, tableName string, columnNames ...strin
|
||||
}
|
||||
for _, index := range res {
|
||||
indexName := index["column_name"]
|
||||
if len(indexName) > 0 {
|
||||
_, err := sess.Exec(fmt.Sprintf("DROP INDEX `%s` ON `%s`", indexName, tableName))
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Now drop the columns
|
||||
cols := ""
|
||||
|
Loading…
Reference in New Issue
Block a user