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
|
@ -58,7 +58,7 @@ func UnwrapLDAPSourceCfg(x *xorm.Engine) error {
|
|||
}
|
||||
|
||||
// change lower_email as unique
|
||||
if err := x.Sync2(new(LoginSource)); err != nil {
|
||||
if err := x.Sync(new(LoginSource)); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
|
|
|
@ -16,7 +16,7 @@ func AddAgitFlowPullRequest(x *xorm.Engine) error {
|
|||
Flow PullRequestFlow `xorm:"NOT NULL DEFAULT 0"`
|
||||
}
|
||||
|
||||
if err := x.Sync2(new(PullRequest)); err != nil {
|
||||
if err := x.Sync(new(PullRequest)); err != nil {
|
||||
return fmt.Errorf("sync2: %w", err)
|
||||
}
|
||||
return nil
|
||||
|
|
|
@ -16,7 +16,7 @@ func AddRepoIDForAttachment(x *xorm.Engine) error {
|
|||
ReleaseID int64 `xorm:"INDEX"` // maybe zero when creating
|
||||
UploaderID int64 `xorm:"INDEX DEFAULT 0"`
|
||||
}
|
||||
if err := x.Sync2(new(Attachment)); err != nil {
|
||||
if err := x.Sync(new(Attachment)); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
|
|
|
@ -14,8 +14,8 @@ func AddBranchProtectionUnprotectedFilesColumn(x *xorm.Engine) error {
|
|||
UnprotectedFilePatterns string `xorm:"TEXT"`
|
||||
}
|
||||
|
||||
if err := x.Sync2(new(ProtectedBranch)); err != nil {
|
||||
return fmt.Errorf("Sync2: %w", err)
|
||||
if err := x.Sync(new(ProtectedBranch)); err != nil {
|
||||
return fmt.Errorf("Sync: %w", err)
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
|
|
@ -18,8 +18,8 @@ func AddTableCommitStatusIndex(x *xorm.Engine) error {
|
|||
MaxIndex int64 `xorm:"index"`
|
||||
}
|
||||
|
||||
if err := x.Sync2(new(CommitStatusIndex)); err != nil {
|
||||
return fmt.Errorf("Sync2: %w", err)
|
||||
if err := x.Sync(new(CommitStatusIndex)); err != nil {
|
||||
return fmt.Errorf("Sync: %w", err)
|
||||
}
|
||||
|
||||
sess := x.NewSession()
|
||||
|
|
|
@ -14,8 +14,8 @@ func AddColorColToProjectBoard(x *xorm.Engine) error {
|
|||
Color string `xorm:"VARCHAR(7)"`
|
||||
}
|
||||
|
||||
if err := x.Sync2(new(ProjectBoard)); err != nil {
|
||||
return fmt.Errorf("Sync2: %w", err)
|
||||
if err := x.Sync(new(ProjectBoard)); err != nil {
|
||||
return fmt.Errorf("Sync: %w", err)
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
|
|
@ -15,5 +15,5 @@ func AddRenamedBranchTable(x *xorm.Engine) error {
|
|||
To string
|
||||
CreatedUnix int64 `xorm:"created"`
|
||||
}
|
||||
return x.Sync2(new(RenamedBranch))
|
||||
return x.Sync(new(RenamedBranch))
|
||||
}
|
||||
|
|
|
@ -25,8 +25,8 @@ func AddTableIssueContentHistory(x *xorm.Engine) error {
|
|||
|
||||
sess := x.NewSession()
|
||||
defer sess.Close()
|
||||
if err := sess.Sync2(new(IssueContentHistory)); err != nil {
|
||||
return fmt.Errorf("Sync2: %w", err)
|
||||
if err := sess.Sync(new(IssueContentHistory)); err != nil {
|
||||
return fmt.Errorf("Sync: %w", err)
|
||||
}
|
||||
return sess.Commit()
|
||||
}
|
||||
|
|
|
@ -15,8 +15,8 @@ func AddTableAppState(x *xorm.Engine) error {
|
|||
Revision int64
|
||||
Content string `xorm:"LONGTEXT"`
|
||||
}
|
||||
if err := x.Sync2(new(AppState)); err != nil {
|
||||
return fmt.Errorf("Sync2: %w", err)
|
||||
if err := x.Sync(new(AppState)); err != nil {
|
||||
return fmt.Errorf("Sync: %w", err)
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
|
|
@ -16,7 +16,7 @@ func CreateUserSettingsTable(x *xorm.Engine) error {
|
|||
SettingKey string `xorm:"varchar(255) index unique(key_userid)"` // ensure key is always lowercase
|
||||
SettingValue string `xorm:"text"`
|
||||
}
|
||||
if err := x.Sync2(new(UserSetting)); err != nil {
|
||||
if err := x.Sync(new(UserSetting)); err != nil {
|
||||
return fmt.Errorf("sync2: %w", err)
|
||||
}
|
||||
return nil
|
||||
|
|
|
@ -13,5 +13,5 @@ func AddProjectIssueSorting(x *xorm.Engine) error {
|
|||
Sorting int64 `xorm:"NOT NULL DEFAULT 0"`
|
||||
}
|
||||
|
||||
return x.Sync2(new(ProjectIssue))
|
||||
return x.Sync(new(ProjectIssue))
|
||||
}
|
||||
|
|
|
@ -10,5 +10,5 @@ func AddSSHKeyIsVerified(x *xorm.Engine) error {
|
|||
Verified bool `xorm:"NOT NULL DEFAULT false"`
|
||||
}
|
||||
|
||||
return x.Sync2(new(PublicKey))
|
||||
return x.Sync(new(PublicKey))
|
||||
}
|
||||
|
|
|
@ -18,7 +18,7 @@ func AddAuthorizeColForTeamUnit(x *xorm.Engine) error {
|
|||
AccessMode int
|
||||
}
|
||||
|
||||
if err := x.Sync2(new(TeamUnit)); err != nil {
|
||||
if err := x.Sync(new(TeamUnit)); err != nil {
|
||||
return fmt.Errorf("sync2: %w", err)
|
||||
}
|
||||
|
||||
|
|
|
@ -34,7 +34,7 @@ func RemigrateU2FCredentials(x *xorm.Engine) error {
|
|||
CreatedUnix timeutil.TimeStamp `xorm:"INDEX created"`
|
||||
UpdatedUnix timeutil.TimeStamp `xorm:"INDEX updated"`
|
||||
}
|
||||
if err := x.Sync2(&webauthnCredential{}); err != nil {
|
||||
if err := x.Sync(&webauthnCredential{}); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue