File tree 9 files changed +39
-10
lines changed
9 files changed +39
-10
lines changed Original file line number Diff line number Diff line change @@ -123,7 +123,7 @@ require (
123
123
mvdan.cc/xurls/v2 v2.5.0
124
124
strk.kbt.io/projects/go/libravatar v0.0.0-20191008002943-06d1c002b251
125
125
xorm.io/builder v0.3.13
126
- xorm.io/xorm v1.3.8
126
+ xorm.io/xorm v1.3.9
127
127
)
128
128
129
129
require (
Original file line number Diff line number Diff line change @@ -1064,5 +1064,5 @@ strk.kbt.io/projects/go/libravatar v0.0.0-20191008002943-06d1c002b251 h1:mUcz5b3
1064
1064
strk.kbt.io/projects/go/libravatar v0.0.0-20191008002943-06d1c002b251 /go.mod h1:FJGmPh3vz9jSos1L/F91iAgnC/aejc0wIIrF2ZwJxdY =
1065
1065
xorm.io/builder v0.3.13 h1:a3jmiVVL19psGeXx8GIurTp7p0IIgqeDmwhcR6BAOAo =
1066
1066
xorm.io/builder v0.3.13 /go.mod h1:aUW0S9eb9VCaPohFCH3j7czOx1PMW3i1HrSzbLYGBSE =
1067
- xorm.io/xorm v1.3.8 h1:CJmplmWqfSRpLWSPMmqz+so8toBp3m7ehuRehIWedZo =
1068
- xorm.io/xorm v1.3.8 /go.mod h1:LsCCffeeYp63ssk0pKumP6l96WZcHix7ChpurcLNuMw =
1067
+ xorm.io/xorm v1.3.9 h1:TUovzS0ko+IQ1XnNLfs5dqK1cJl1H5uHpWbWqAQ04nU =
1068
+ xorm.io/xorm v1.3.9 /go.mod h1:LsCCffeeYp63ssk0pKumP6l96WZcHix7ChpurcLNuMw =
Original file line number Diff line number Diff line change @@ -12,5 +12,9 @@ func AddIndexToActionUserID(x *xorm.Engine) error {
12
12
UserID int64 `xorm:"INDEX"`
13
13
}
14
14
15
- return x .Sync (new (Action ))
15
+ _ , err := x .SyncWithOptions (xorm.SyncOptions {
16
+ IgnoreDropIndices : true ,
17
+ IgnoreConstrains : true ,
18
+ }, new (Action ))
19
+ return err
16
20
}
Original file line number Diff line number Diff line change @@ -10,5 +10,9 @@ func AddIgnoreStaleApprovalsColumnToProtectedBranchTable(x *xorm.Engine) error {
10
10
type ProtectedBranch struct {
11
11
IgnoreStaleApprovals bool `xorm:"NOT NULL DEFAULT false"`
12
12
}
13
- return x .Sync (new (ProtectedBranch ))
13
+ _ , err := x .SyncWithOptions (xorm.SyncOptions {
14
+ IgnoreIndices : true ,
15
+ IgnoreConstrains : true ,
16
+ }, new (ProtectedBranch ))
17
+ return err
14
18
}
Original file line number Diff line number Diff line change @@ -14,5 +14,9 @@ func AddPreviousDurationToActionRun(x *xorm.Engine) error {
14
14
PreviousDuration time.Duration
15
15
}
16
16
17
- return x .Sync (& ActionRun {})
17
+ _ , err := x .SyncWithOptions (xorm.SyncOptions {
18
+ IgnoreIndices : true ,
19
+ IgnoreConstrains : true ,
20
+ }, & ActionRun {})
21
+ return err
18
22
}
Original file line number Diff line number Diff line change @@ -86,7 +86,10 @@ func addObjectFormatNameToRepository(x *xorm.Engine) error {
86
86
ObjectFormatName string `xorm:"VARCHAR(6) NOT NULL DEFAULT 'sha1'"`
87
87
}
88
88
89
- if err := x .Sync (new (Repository )); err != nil {
89
+ if _ , err := x .SyncWithOptions (xorm.SyncOptions {
90
+ IgnoreIndices : true ,
91
+ IgnoreConstrains : true ,
92
+ }, new (Repository )); err != nil {
90
93
return err
91
94
}
92
95
Original file line number Diff line number Diff line change @@ -10,7 +10,10 @@ func AddDefaultWikiBranch(x *xorm.Engine) error {
10
10
ID int64
11
11
DefaultWikiBranch string
12
12
}
13
- if err := x .Sync (& Repository {}); err != nil {
13
+ if _ , err := x .SyncWithOptions (xorm.SyncOptions {
14
+ IgnoreIndices : true ,
15
+ IgnoreConstrains : true ,
16
+ }, & Repository {}); err != nil {
14
17
return err
15
18
}
16
19
_ , err := x .Exec ("UPDATE `repository` SET default_wiki_branch = 'master' WHERE (default_wiki_branch IS NULL) OR (default_wiki_branch = '')" )
Original file line number Diff line number Diff line change @@ -13,5 +13,12 @@ type HookTask struct {
13
13
14
14
func AddPayloadVersionToHookTaskTable (x * xorm.Engine ) error {
15
15
// create missing column
16
- return x .Sync (new (HookTask ))
16
+ if _ , err := x .SyncWithOptions (xorm.SyncOptions {
17
+ IgnoreIndices : true ,
18
+ IgnoreConstrains : true ,
19
+ }, new (HookTask )); err != nil {
20
+ return err
21
+ }
22
+ _ , err := x .Exec ("UPDATE hook_task SET payload_version = 1 WHERE payload_version IS NULL" )
23
+ return err
17
24
}
Original file line number Diff line number Diff line change @@ -10,5 +10,9 @@ func AddCommentIDIndexofAttachment(x *xorm.Engine) error {
10
10
CommentID int64 `xorm:"INDEX"`
11
11
}
12
12
13
- return x .Sync (& Attachment {})
13
+ _ , err := x .SyncWithOptions (xorm.SyncOptions {
14
+ IgnoreDropIndices : true ,
15
+ IgnoreConstrains : true ,
16
+ }, & Attachment {})
17
+ return err
14
18
}
You can’t perform that action at this time.
0 commit comments