aboutsummaryrefslogtreecommitdiffstats
path: root/models
diff options
context:
space:
mode:
authorzeripath <art27@cantab.net>2021-05-07 00:17:43 +0100
committerGitHub <noreply@github.com>2021-05-07 00:17:43 +0100
commitedb838997c41af7704aba4dbffeee608ffd18d3c (patch)
tree14768e5a094feba82879c426e49f077c5a8bb113 /models
parent45970ae82e478dd7d5f01fcc053de5df00198abc (diff)
downloadgitea-edb838997c41af7704aba4dbffeee608ffd18d3c.tar.gz
gitea-edb838997c41af7704aba4dbffeee608ffd18d3c.zip
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 <art27@cantab.net> * Update models_test.go
Diffstat (limited to 'models')
-rw-r--r--models/models.go2
-rw-r--r--models/models_test.go2
2 files changed, 2 insertions, 2 deletions
diff --git a/models/models.go b/models/models.go
index 73e65d828b..b0a9062566 100644
--- a/models/models.go
+++ b/models/models.go
@@ -320,7 +320,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 2441ad7fb0..9793394e0b 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)