Skip to content

Commit 52ca7b9

Browse files
authored
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 <[email protected]> * Update models_test.go
1 parent e078d08 commit 52ca7b9

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

models/models.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -319,7 +319,7 @@ func DumpDatabase(filePath, dbType string) error {
319319
ID int64 `xorm:"pk autoincr"`
320320
Version int64
321321
}
322-
t, err := x.TableInfo(Version{})
322+
t, err := x.TableInfo(&Version{})
323323
if err != nil {
324324
return err
325325
}

models/models_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ func TestDumpDatabase(t *testing.T) {
2525
ID int64 `xorm:"pk autoincr"`
2626
Version int64
2727
}
28-
assert.NoError(t, x.Sync2(Version{}))
28+
assert.NoError(t, x.Sync2(new(Version)))
2929

3030
for _, dbName := range setting.SupportedDatabases {
3131
dbType := setting.GetDBTypeByName(dbName)

0 commit comments

Comments
 (0)