1
1
mirror of https://github.com/go-gitea/gitea synced 2025-07-03 09:07:19 +00: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:
delvh
2023-08-13 21:17:21 +02:00
committed by GitHub
parent 50fc22eecf
commit e10ba5e5e0
122 changed files with 184 additions and 184 deletions

View File

@ -23,5 +23,5 @@ func AddUploaderIDForAttachment(x *xorm.Engine) error {
CreatedUnix timeutil.TimeStamp `xorm:"created"`
}
return x.Sync2(new(Attachment))
return x.Sync(new(Attachment))
}

View File

@ -13,5 +13,5 @@ func AddGPGKeyImport(x *xorm.Engine) error {
Content string `xorm:"TEXT NOT NULL"`
}
return x.Sync2(new(GPGKeyImport))
return x.Sync(new(GPGKeyImport))
}

View File

@ -40,8 +40,8 @@ func HashAppToken(x *xorm.Engine) error {
return err
}
if err := sess.Sync2(new(AccessToken)); err != nil {
return fmt.Errorf("Sync2: %w", err)
if err := sess.Sync(new(AccessToken)); err != nil {
return fmt.Errorf("Sync: %w", err)
}
if err := sess.Commit(); err != nil {
@ -112,8 +112,8 @@ func resyncHashAppTokenWithUniqueHash(x *xorm.Engine) error {
if err := sess.Begin(); err != nil {
return err
}
if err := sess.Sync2(new(AccessToken)); err != nil {
return fmt.Errorf("Sync2: %w", err)
if err := sess.Sync(new(AccessToken)); err != nil {
return fmt.Errorf("Sync: %w", err)
}
return sess.Commit()
}

View File

@ -12,5 +12,5 @@ func AddHTTPMethodToWebhook(x *xorm.Engine) error {
HTTPMethod string `xorm:"http_method DEFAULT 'POST'"`
}
return x.Sync2(new(Webhook))
return x.Sync(new(Webhook))
}

View File

@ -13,5 +13,5 @@ func AddAvatarFieldToRepository(x *xorm.Engine) error {
Avatar string `xorm:"VARCHAR(64)"`
}
return x.Sync2(new(Repository))
return x.Sync(new(Repository))
}