Migration: Remove table aliasing in delete statement to make it work for mariadb (#95226)

Migration: remove table aliasing in delete statement to make it work in mariadb
This commit is contained in:
Karl Persson 2024-10-23 10:49:20 +02:00 committed by GitHub
parent 5e924f3a27
commit 6f7528f896
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -86,7 +86,7 @@ func (m *orphanedServiceAccountPermissions) exec(sess *xorm.Session, mg *migrato
}
// delete all orphaned permissions
rawDelete := "DELETE FROM permission AS p WHERE p.kind = 'serviceaccounts' AND p.identifier IN(?" + strings.Repeat(",?", len(orphaned)-1) + ")"
rawDelete := "DELETE FROM permission WHERE kind = 'serviceaccounts' AND identifier IN(?" + strings.Repeat(",?", len(orphaned)-1) + ")"
deleteArgs := make([]any, 0, len(orphaned)+1)
deleteArgs = append(deleteArgs, rawDelete)
for _, id := range orphaned {