mirror of
https://codeberg.org/forgejo/forgejo.git
synced 2025-08-06 02:15:20 +02:00
Rename Sync2
-> Sync
(#26479)
The xorm `Sync2` has already been deprecated in favor of `Sync`, so let's do the same inside the Gitea codebase. Command used to replace everything: ```sh for i in $(ag Sync2 --files-with-matches); do vim $i -c ':%sno/Sync2/Sync/g' -c ':wq'; done ```
This commit is contained in:
parent
50fc22eecf
commit
e10ba5e5e0
122 changed files with 184 additions and 184 deletions
|
@ -13,5 +13,5 @@ func AddWhitelistDeployKeysToBranches(x *xorm.Engine) error {
|
|||
WhitelistDeployKeys bool `xorm:"NOT NULL DEFAULT false"`
|
||||
}
|
||||
|
||||
return x.Sync2(new(ProtectedBranch))
|
||||
return x.Sync(new(ProtectedBranch))
|
||||
}
|
||||
|
|
|
@ -15,7 +15,7 @@ func RemoveLabelUneededCols(x *xorm.Engine) error {
|
|||
QueryString string
|
||||
IsSelected bool
|
||||
}
|
||||
if err := x.Sync2(new(Label)); err != nil {
|
||||
if err := x.Sync(new(Label)); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
|
|
|
@ -13,7 +13,7 @@ func AddTeamIncludesAllRepositories(x *xorm.Engine) error {
|
|||
IncludesAllRepositories bool `xorm:"NOT NULL DEFAULT false"`
|
||||
}
|
||||
|
||||
if err := x.Sync2(new(Team)); err != nil {
|
||||
if err := x.Sync(new(Team)); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
|
|
|
@ -17,7 +17,7 @@ type Watch struct {
|
|||
}
|
||||
|
||||
func AddModeColumnToWatch(x *xorm.Engine) error {
|
||||
if err := x.Sync2(new(Watch)); err != nil {
|
||||
if err := x.Sync(new(Watch)); err != nil {
|
||||
return err
|
||||
}
|
||||
_, err := x.Exec("UPDATE `watch` SET `mode` = 1")
|
||||
|
|
|
@ -13,5 +13,5 @@ func AddTemplateToRepo(x *xorm.Engine) error {
|
|||
TemplateID int64 `xorm:"INDEX"`
|
||||
}
|
||||
|
||||
return x.Sync2(new(Repository))
|
||||
return x.Sync(new(Repository))
|
||||
}
|
||||
|
|
|
@ -13,5 +13,5 @@ func AddCommentIDOnNotification(x *xorm.Engine) error {
|
|||
CommentID int64
|
||||
}
|
||||
|
||||
return x.Sync2(new(Notification))
|
||||
return x.Sync(new(Notification))
|
||||
}
|
||||
|
|
|
@ -12,5 +12,5 @@ func AddCanCreateOrgRepoColumnForTeam(x *xorm.Engine) error {
|
|||
CanCreateOrgRepo bool `xorm:"NOT NULL DEFAULT false"`
|
||||
}
|
||||
|
||||
return x.Sync2(new(Team))
|
||||
return x.Sync(new(Team))
|
||||
}
|
||||
|
|
|
@ -36,11 +36,11 @@ func AddBranchProtectionCanPushAndEnableWhitelist(x *xorm.Engine) error {
|
|||
IssueID int64 `xorm:"index"`
|
||||
}
|
||||
|
||||
if err := x.Sync2(new(ProtectedBranch)); err != nil {
|
||||
if err := x.Sync(new(ProtectedBranch)); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
if err := x.Sync2(new(Review)); err != nil {
|
||||
if err := x.Sync(new(Review)); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
|
|
|
@ -15,8 +15,8 @@ func FeatureChangeTargetBranch(x *xorm.Engine) error {
|
|||
NewRef string
|
||||
}
|
||||
|
||||
if err := x.Sync2(new(Comment)); err != nil {
|
||||
return fmt.Errorf("Sync2: %w", err)
|
||||
if err := x.Sync(new(Comment)); err != nil {
|
||||
return fmt.Errorf("Sync: %w", err)
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
|
|
@ -24,7 +24,7 @@ func ExtendTrackedTimes(x *xorm.Engine) error {
|
|||
return err
|
||||
}
|
||||
|
||||
if err := sess.Sync2(new(TrackedTime)); err != nil {
|
||||
if err := sess.Sync(new(TrackedTime)); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue