File tree Expand file tree Collapse file tree 13 files changed +64
-20
lines changed Expand file tree Collapse file tree 13 files changed +64
-20
lines changed Original file line number Diff line number Diff line change @@ -14,5 +14,9 @@ func AddContentVersionToIssueAndComment(x *xorm.Engine) error {
14
14
ContentVersion int `xorm:"NOT NULL DEFAULT 0"`
15
15
}
16
16
17
- return x .Sync (new (Comment ), new (Issue ))
17
+ _ , err := x .SyncWithOptions (xorm.SyncOptions {
18
+ IgnoreConstrains : true ,
19
+ IgnoreIndices : true ,
20
+ }, new (Comment ), new (Issue ))
21
+ return err
18
22
}
Original file line number Diff line number Diff line change @@ -13,5 +13,9 @@ func AddForcePushBranchProtection(x *xorm.Engine) error {
13
13
ForcePushAllowlistTeamIDs []int64 `xorm:"JSON TEXT"`
14
14
ForcePushAllowlistDeployKeys bool `xorm:"NOT NULL DEFAULT false"`
15
15
}
16
- return x .Sync (new (ProtectedBranch ))
16
+ _ , err := x .SyncWithOptions (xorm.SyncOptions {
17
+ IgnoreConstrains : true ,
18
+ IgnoreIndices : true ,
19
+ }, new (ProtectedBranch ))
20
+ return err
17
21
}
Original file line number Diff line number Diff line change @@ -10,5 +10,9 @@ func AddSkipSecondaryAuthColumnToOAuth2ApplicationTable(x *xorm.Engine) error {
10
10
type oauth2Application struct {
11
11
SkipSecondaryAuthorization bool `xorm:"NOT NULL DEFAULT FALSE"`
12
12
}
13
- return x .Sync (new (oauth2Application ))
13
+ _ , err := x .SyncWithOptions (xorm.SyncOptions {
14
+ IgnoreConstrains : true ,
15
+ IgnoreIndices : true ,
16
+ }, new (oauth2Application ))
17
+ return err
14
18
}
Original file line number Diff line number Diff line change @@ -19,5 +19,9 @@ func AddCommentMetaDataColumn(x *xorm.Engine) error {
19
19
CommentMetaData * CommentMetaData `xorm:"JSON TEXT"` // put all non-index metadata in a single field
20
20
}
21
21
22
- return x .Sync (new (Comment ))
22
+ _ , err := x .SyncWithOptions (xorm.SyncOptions {
23
+ IgnoreConstrains : true ,
24
+ IgnoreIndices : true ,
25
+ }, new (Comment ))
26
+ return err
23
27
}
Original file line number Diff line number Diff line change @@ -9,5 +9,9 @@ func AddBlockAdminMergeOverrideBranchProtection(x *xorm.Engine) error {
9
9
type ProtectedBranch struct {
10
10
BlockAdminMergeOverride bool `xorm:"NOT NULL DEFAULT false"`
11
11
}
12
- return x .Sync (new (ProtectedBranch ))
12
+ _ , err := x .SyncWithOptions (xorm.SyncOptions {
13
+ IgnoreConstrains : true ,
14
+ IgnoreIndices : true ,
15
+ }, new (ProtectedBranch ))
16
+ return err
13
17
}
Original file line number Diff line number Diff line change @@ -12,5 +12,9 @@ func AddPriorityToProtectedBranch(x *xorm.Engine) error {
12
12
Priority int64 `xorm:"NOT NULL DEFAULT 0"`
13
13
}
14
14
15
- return x .Sync (new (ProtectedBranch ))
15
+ _ , err := x .SyncWithOptions (xorm.SyncOptions {
16
+ IgnoreConstrains : true ,
17
+ IgnoreIndices : true ,
18
+ }, new (ProtectedBranch ))
19
+ return err
16
20
}
Original file line number Diff line number Diff line change @@ -11,6 +11,9 @@ func AddTimeEstimateColumnToIssueTable(x *xorm.Engine) error {
11
11
type Issue struct {
12
12
TimeEstimate int64 `xorm:"NOT NULL DEFAULT 0"`
13
13
}
14
-
15
- return x .Sync (new (Issue ))
14
+ _ , err := x .SyncWithOptions (xorm.SyncOptions {
15
+ IgnoreConstrains : true ,
16
+ IgnoreIndices : true ,
17
+ }, new (Issue ))
18
+
93C6
return err
16
19
}
Original file line number Diff line number Diff line change @@ -17,5 +17,9 @@ func (pullAutoMerge) TableName() string {
17
17
}
18
18
19
19
func AddDeleteBranchAfterMergeForAutoMerge (x * xorm.Engine ) error {
20
- return x .Sync (new (pullAutoMerge ))
20
+ _ , err := x .SyncWithOptions (xorm.SyncOptions {
21
+ IgnoreConstrains : true ,
22
+ IgnoreIndices : true ,
23
+ }, new (pullAutoMerge ))
24
+ return err
21
25
}
Original file line number Diff line number Diff line change @@ -11,6 +11,9 @@ func AddEphemeralToActionRunner(x *xorm.Engine) error {
11
11
type ActionRunner struct {
12
12
Ephemeral bool `xorm:"ephemeral NOT NULL DEFAULT false"`
13
13
}
14
-
15
- return x .Sync (new (ActionRunner ))
14
+ _ , err := x .SyncWithOptions (xorm.SyncOptions {
15
+ IgnoreConstrains : true ,
16
+ IgnoreIndices : true ,
17
+ }, new (ActionRunner ))
18
+ return err
16
19
}
Original file line number Diff line number Diff line change @@ -16,5 +16,9 @@ func AddDescriptionForSecretsAndVariables(x *xorm.Engine) error {
16
16
Description string `xorm:"TEXT"`
17
17
}
18
18
19
- return x .Sync (new (Secret ), new (ActionVariable ))
19
+ _ , err := x .SyncWithOptions (xorm.SyncOptions {
20
+ IgnoreConstrains : true ,
21
+ IgnoreIndices : true ,
22
+ }, new (Secret ), new (ActionVariable ))
23
+ return err
20
24
}
You can’t perform that action at this time.
0 commit comments