1
1
mirror of https://github.com/go-gitea/gitea synced 2025-08-11 12:08:21 +00:00

Fix MySQL and PostgreSQL column drop SQL (#3649) (#3651)

This commit is contained in:
Lauris BH
2018-03-10 04:27:19 +02:00
committed by Lunny Xiao
parent 92a3061753
commit 5d0c9872a9

View File

@@ -233,7 +233,7 @@ func dropTableColumns(x *xorm.Engine, tableName string, columnNames ...string) (
}
cols += "DROP COLUMN `" + col + "`"
}
if _, err := x.Exec(fmt.Sprintf("ALTER TABLE `%s` %s", tableName, columnNames)); err != nil {
if _, err := x.Exec(fmt.Sprintf("ALTER TABLE `%s` %s", tableName, cols)); err != nil {
return fmt.Errorf("Drop table `%s` columns %v: %v", tableName, columnNames, err)
}
case setting.UseMSSQL: