loading up the forgejo repo on tangled to test page performance
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

Upgrade xorm to v1.3.9 and improve some migrations Sync (#29899)

Co-authored-by: 6543 <6543@obermui.de>
(cherry picked from commit 0d08bb6112884411eb4f58b056278d3c824a8fc0)

authored by

Lunny Xiao
6543
and committed by
Gergely Nagy
54f2dcff d0227c23

+36 -7
+5 -1
models/migrations/v1_21/v279.go
··· 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 }
+5 -1
models/migrations/v1_22/v284.go
··· 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 }
+5 -1
models/migrations/v1_22/v285.go
··· 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 }
+4 -1
models/migrations/v1_22/v286.go
··· 54 54 ObjectFormatName string `xorm:"VARCHAR(6) NOT NULL DEFAULT 'sha1'"` 55 55 } 56 56 57 - if err := x.Sync(new(Repository)); err != nil { 57 + if _, err := x.SyncWithOptions(xorm.SyncOptions{ 58 + IgnoreIndices: true, 59 + IgnoreConstrains: true, 60 + }, new(Repository)); err != nil { 58 61 return err 59 62 } 60 63
+4 -1
models/migrations/v1_22/v289.go
··· 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 = '')")
+8 -1
models/migrations/v1_22/v290.go
··· 35 35 36 36 func AddPayloadVersionToHookTaskTable(x *xorm.Engine) error { 37 37 // create missing column 38 - return x.Sync(new(HookTask)) 38 + if _, err := x.SyncWithOptions(xorm.SyncOptions{ 39 + IgnoreIndices: true, 40 + IgnoreConstrains: true, 41 + }, new(HookTask)); err != nil { 42 + return err 43 + } 44 + _, err := x.Exec("UPDATE hook_task SET payload_version = 1 WHERE payload_version IS NULL") 45 + return err 39 46 }
+5 -1
models/migrations/v1_22/v291.go
··· 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 }