0
Fork 0
mirror of https://codeberg.org/forgejo/forgejo.git synced 2025-01-11 17:11:16 -05:00

Fix MySQL and PostgreSQL column drop SQL (#3649)

This commit is contained in:
Lauris BH 2018-03-09 03:20:57 +02:00 committed by Bo-Yi Wu
parent 1a83581121
commit de8a091767

View file

@ -233,7 +233,7 @@ func dropTableColumns(x *xorm.Engine, tableName string, columnNames ...string) (
} }
cols += "DROP COLUMN `" + col + "`" 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) return fmt.Errorf("Drop table `%s` columns %v: %v", tableName, columnNames, err)
} }
case setting.UseMSSQL: case setting.UseMSSQL: