Skip to content

Commit edb8389

Browse files
authored
Fix setting version table in dump (#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 45970ae commit edb8389

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
@@ -320,7 +320,7 @@ func DumpDatabase(filePath, dbType string) error {
320320
ID int64 `xorm:"pk autoincr"`
321321
Version int64
322322
}
323-
t, err := x.TableInfo(Version{})
323+
t, err := x.TableInfo(&Version{})
324324
if err != nil {
325325
return err
326326
}

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)