aboutsummaryrefslogtreecommitdiffstats
path: root/models/db
diff options
context:
space:
mode:
authordelvh <dev.lh@web.de>2023-08-13 21:17:21 +0200
committerGitHub <noreply@github.com>2023-08-13 21:17:21 +0200
commite10ba5e5e0b5de2cedff2f180cc17245158aee25 (patch)
tree8c6efbf255535802cd68d06b284af262d4e57739 /models/db
parent50fc22eecfd9d96f4b15d75e1b9f85d83715db87 (diff)
downloadgitea-e10ba5e5e0b5de2cedff2f180cc17245158aee25.tar.gz
gitea-e10ba5e5e0b5de2cedff2f180cc17245158aee25.zip
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 ```
Diffstat (limited to 'models/db')
-rwxr-xr-xmodels/db/engine.go4
-rw-r--r--models/db/engine_test.go2
2 files changed, 3 insertions, 3 deletions
diff --git a/models/db/engine.go b/models/db/engine.go
index 07e4d00270..182d8cd993 100755
--- a/models/db/engine.go
+++ b/models/db/engine.go
@@ -55,7 +55,7 @@ type Engine interface {
Limit(limit int, start ...int) *xorm.Session
NoAutoTime() *xorm.Session
SumInt(bean any, columnName string) (res int64, err error)
- Sync2(...any) error
+ Sync(...any) error
Select(string) *xorm.Session
NotIn(string, ...any) *xorm.Session
OrderBy(any, ...any) *xorm.Session
@@ -172,7 +172,7 @@ func UnsetDefaultEngine() {
}
// InitEngineWithMigration initializes a new xorm.Engine and sets it as the db.DefaultContext
-// This function must never call .Sync2() if the provided migration function fails.
+// This function must never call .Sync() if the provided migration function fails.
// When called from the "doctor" command, the migration function is a version check
// that prevents the doctor from fixing anything in the database if the migration level
// is different from the expected value.
diff --git a/models/db/engine_test.go b/models/db/engine_test.go
index 5514366777..e3dbfbdc24 100644
--- a/models/db/engine_test.go
+++ b/models/db/engine_test.go
@@ -26,7 +26,7 @@ func TestDumpDatabase(t *testing.T) {
ID int64 `xorm:"pk autoincr"`
Version int64
}
- assert.NoError(t, db.GetEngine(db.DefaultContext).Sync2(new(Version)))
+ assert.NoError(t, db.GetEngine(db.DefaultContext).Sync(new(Version)))
for _, dbType := range setting.SupportedDatabaseTypes {
assert.NoError(t, db.DumpDatabase(filepath.Join(dir, dbType+".sql"), dbType))