From 52ca7b9b6532c705af6eec6376fbc812b9dfcc27 Mon Sep 17 00:00:00 2001 From: zeripath Date: Fri, 7 May 2021 13:04:17 +0100 Subject: [PATCH] Fix setting version table in dump (#15753) (#15759) Backport #15753 * Fix setting version table in dump As noted on Discord there is a problem with gitea dump where the version table is not being dumped correctly. This is due to a missing pointer in the TableInfo. This PR fixes this. Signed-off-by: Andrew Thornton * Update models_test.go --- models/models.go | 2 +- models/models_test.go | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/models/models.go b/models/models.go index 05cafccd1..6c92e8d65 100644 --- a/models/models.go +++ b/models/models.go @@ -319,7 +319,7 @@ func DumpDatabase(filePath, dbType string) error { ID int64 `xorm:"pk autoincr"` Version int64 } - t, err := x.TableInfo(Version{}) + t, err := x.TableInfo(&Version{}) if err != nil { return err } diff --git a/models/models_test.go b/models/models_test.go index 2441ad7fb..9793394e0 100644 --- a/models/models_test.go +++ b/models/models_test.go @@ -25,7 +25,7 @@ func TestDumpDatabase(t *testing.T) { ID int64 `xorm:"pk autoincr"` Version int64 } - assert.NoError(t, x.Sync2(Version{})) + assert.NoError(t, x.Sync2(new(Version))) for _, dbName := range setting.SupportedDatabases { dbType := setting.GetDBTypeByName(dbName)