fix: error message check on mysql

This commit is contained in:
kolaente 2024-10-28 13:50:12 +01:00
parent a70c472aa3
commit 29107e9865
No known key found for this signature in database
GPG Key ID: F40E70337AB24C9B
1 changed files with 2 additions and 2 deletions

View File

@ -19,6 +19,7 @@ package migration
import (
"code.vikunja.io/api/pkg/db"
"src.techknowlogick.com/xormigrate"
"strings"
"xorm.io/xorm"
"xorm.io/xorm/schemas"
)
@ -51,8 +52,7 @@ func init() {
for _, query := range queries {
_, err := tx.Exec(query)
if err != nil && err.Error() != "Error 1061: Duplicate key name 'IDX_projects_owner_id'" &&
err.Error() != "Error 1061: Duplicate key name 'IDX_projects_parent_project_id'" {
if err != nil && !(strings.Contains(err.Error(), "Error 1061") && strings.Contains(err.Error(), "Duplicate key name")) {
return err
}
}