Skip to content

Commit 2a1d34a

Browse files
committed
Don't sync index when adding a new column
1 parent e46230a commit 2a1d34a

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

models/migrations/v1_24/v320.go

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,13 @@ func MigrateSkipTwoFactor(x *xorm.Engine) error {
1313
type LoginSource struct {
1414
TwoFactorPolicy string `xorm:"two_factor_policy NOT NULL DEFAULT ''"`
1515
}
16-
err := x.Sync(new(LoginSource))
16+
_, err := x.SyncWithOptions(
17+
xorm.SyncOptions{
18+
IgnoreConstrains: true,
19+
IgnoreIndices: true,
20+
},
21+
new(LoginSource),
22+
)
1723
if err != nil {
1824
return err
1925
}

0 commit comments

Comments
 (0)