1
1
mirror of https://github.com/go-gitea/gitea synced 2025-07-22 18:28:37 +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

@@ -18,7 +18,7 @@ func UpdateMigrationServiceTypes(x *xorm.Engine) error {
OriginalURL string `xorm:"VARCHAR(2048)"`
}
if err := x.Sync2(new(Repository)); err != nil {
if err := x.Sync(new(Repository)); err != nil {
return err
}
@@ -78,5 +78,5 @@ func UpdateMigrationServiceTypes(x *xorm.Engine) error {
ExpiresAt time.Time
}
return x.Sync2(new(ExternalLoginUser))
return x.Sync(new(ExternalLoginUser))
}

View File

@@ -14,5 +14,5 @@ func ChangeSomeColumnsLengthOfExternalLoginUser(x *xorm.Engine) error {
RefreshToken string `xorm:"TEXT"`
}
return x.Sync2(new(ExternalLoginUser))
return x.Sync(new(ExternalLoginUser))
}

View File

@@ -21,7 +21,7 @@ func AddCommitStatusContext(x *xorm.Engine) error {
Context string `xorm:"TEXT"`
}
if err := x.Sync2(new(CommitStatus)); err != nil {
if err := x.Sync(new(CommitStatus)); err != nil {
return err
}

View File

@@ -12,7 +12,7 @@ func AddOriginalMigrationInfo(x *xorm.Engine) error {
OriginalAuthorID int64
}
if err := x.Sync2(new(Issue)); err != nil {
if err := x.Sync(new(Issue)); err != nil {
return err
}
@@ -22,7 +22,7 @@ func AddOriginalMigrationInfo(x *xorm.Engine) error {
OriginalAuthorID int64
}
if err := x.Sync2(new(Comment)); err != nil {
if err := x.Sync(new(Comment)); err != nil {
return err
}
@@ -31,5 +31,5 @@ func AddOriginalMigrationInfo(x *xorm.Engine) error {
OriginalURL string
}
return x.Sync2(new(Repository))
return x.Sync(new(Repository))
}

View File

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

View File

@@ -11,7 +11,7 @@ func AddIndexOnRepositoryAndComment(x *xorm.Engine) error {
OwnerID int64 `xorm:"index"`
}
if err := x.Sync2(new(Repository)); err != nil {
if err := x.Sync(new(Repository)); err != nil {
return err
}
@@ -21,5 +21,5 @@ func AddIndexOnRepositoryAndComment(x *xorm.Engine) error {
ReviewID int64 `xorm:"index"`
}
return x.Sync2(new(Comment))
return x.Sync(new(Comment))
}

View File

@@ -11,5 +11,5 @@ func AddEmailNotificationEnabledToUser(x *xorm.Engine) error {
EmailNotificationsPreference string `xorm:"VARCHAR(20) NOT NULL DEFAULT 'enabled'"`
}
return x.Sync2(new(User))
return x.Sync(new(User))
}

View File

@@ -11,7 +11,7 @@ func AddStatusCheckColumnsForProtectedBranches(x *xorm.Engine) error {
StatusCheckContexts []string `xorm:"JSON TEXT"`
}
if err := x.Sync2(new(ProtectedBranch)); err != nil {
if err := x.Sync(new(ProtectedBranch)); err != nil {
return err
}

View File

@@ -15,5 +15,5 @@ func AddCrossReferenceColumns(x *xorm.Engine) error {
RefIsPull bool
}
return x.Sync2(new(Comment))
return x.Sync(new(Comment))
}

View File

@@ -10,5 +10,5 @@ func AddRepoAdminChangeTeamAccessColumnForUser(x *xorm.Engine) error {
RepoAdminChangeTeamAccess bool `xorm:"NOT NULL DEFAULT false"`
}
return x.Sync2(new(User))
return x.Sync(new(User))
}

View File

@@ -12,5 +12,5 @@ func AddOriginalAuthorOnMigratedReleases(x *xorm.Engine) error {
OriginalAuthorID int64 `xorm:"index"`
}
return x.Sync2(new(Release))
return x.Sync(new(Release))
}

View File

@@ -34,5 +34,5 @@ func AddTaskTable(x *xorm.Engine) error {
Status int `xorm:"NOT NULL DEFAULT 0"`
}
return x.Sync2(new(Task), new(Repository))
return x.Sync(new(Task), new(Repository))
}