Add migrations tests (#34456) (#34483)

Backport #34456 by @lunny

Fix #34455

Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
This commit is contained in:
Giteabot
2025-05-16 10:37:06 -04:00
committed by GitHub
co-authored by Lunny Xiao wxiaoguang
parent d6233c25b5
commit d2cbe2fba0
4 changed files with 99 additions and 2 deletions
+4 -1
View File
@@ -9,5 +9,8 @@ func AddIndexForReleaseSha1(x *xorm.Engine) error {
type Release struct {
Sha1 string `xorm:"INDEX VARCHAR(64)"`
}
return x.Sync(new(Release))
_, err := x.SyncWithOptions(xorm.SyncOptions{
IgnoreDropIndices: true,
}, new(Release))
return err
}