1
0
Fork 0
forked from forgejo/forgejo

[CHORE] Remove Microsoft SQL Server Support

- Per https://codeberg.org/forgejo/discussions/issues/122
This commit is contained in:
Gusted 2024-04-04 18:02:24 +02:00
parent af47c583b4
commit 2d9afd0c21
No known key found for this signature in database
GPG key ID: FD821B732837125F
70 changed files with 70 additions and 789 deletions

View file

@ -50,8 +50,7 @@ func RenameWebhookOrgToOwner(x *xorm.Engine) error {
}
}
switch {
case setting.Database.Type.IsMySQL():
if setting.Database.Type.IsMySQL() {
inferredTable, err := x.TableInfo(new(Webhook))
if err != nil {
return err
@ -60,11 +59,7 @@ func RenameWebhookOrgToOwner(x *xorm.Engine) error {
if _, err := sess.Exec(fmt.Sprintf("ALTER TABLE `webhook` CHANGE org_id owner_id %s", sqlType)); err != nil {
return err
}
case setting.Database.Type.IsMSSQL():
if _, err := sess.Exec("sp_rename 'webhook.org_id', 'owner_id', 'COLUMN'"); err != nil {
return err
}
default:
} else {
if _, err := sess.Exec("ALTER TABLE `webhook` RENAME COLUMN org_id TO owner_id"); err != nil {
return err
}