diff options
author | Lunny Xiao <xiaolunwen@gmail.com> | 2017-01-03 16:20:28 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-01-03 16:20:28 +0800 |
commit | 980dd0bf513597abc4753585e6cc7eb8b30272d1 (patch) | |
tree | 8ca1f6bfb1a518cb6bdd5261d2454b279fb43101 /models/models.go | |
parent | 70900bd16724ccb73d8b69e830f046b4815c9595 (diff) | |
download | gitea-980dd0bf513597abc4753585e6cc7eb8b30272d1.tar.gz gitea-980dd0bf513597abc4753585e6cc7eb8b30272d1.zip |
Update xorm and dependencies vendor for feature to dump to other database (#565)
* update xorm and dependencies vendor for feature to dump to other database
* fix golint
Diffstat (limited to 'models/models.go')
-rw-r--r-- | models/models.go | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/models/models.go b/models/models.go index e937580d18..131fd4fdb2 100644 --- a/models/models.go +++ b/models/models.go @@ -319,7 +319,14 @@ func Ping() error { return x.Ping() } -// DumpDatabase dumps all data from database to file system. -func DumpDatabase(filePath string) error { - return x.DumpAllToFile(filePath) +// DumpDatabase dumps all data from database according the special database SQL syntax to file system. +func DumpDatabase(filePath string, dbType string) error { + var tbs []*core.Table + for _, t := range tables { + tbs = append(tbs, x.TableInfo(t).Table) + } + if len(dbType) > 0 { + return x.DumpTablesToFile(tbs, filePath, core.DbType(dbType)) + } + return x.DumpTablesToFile(tbs, filePath) } |