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 /cmd | |
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 'cmd')
-rw-r--r-- | cmd/dump.go | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/cmd/dump.go b/cmd/dump.go index 325ad40451..5c31ac66de 100644 --- a/cmd/dump.go +++ b/cmd/dump.go @@ -41,6 +41,10 @@ It can be used for backup and capture Gitea server image to send to maintainer`, Value: os.TempDir(), Usage: "Temporary dir path", }, + cli.StringFlag{ + Name: "database, d", + Usage: "Specify the database SQL syntax", + }, }, } @@ -71,8 +75,14 @@ func runDump(ctx *cli.Context) error { log.Fatalf("Fail to dump local repositories: %v", err) } - log.Printf("Dumping database...") - if err := models.DumpDatabase(dbDump); err != nil { + targetDBType := ctx.String("database") + if len(targetDBType) > 0 && targetDBType != models.DbCfg.Type { + log.Printf("Dumping database %s => %s...", models.DbCfg.Type, targetDBType) + } else { + log.Printf("Dumping database...") + } + + if err := models.DumpDatabase(dbDump, targetDBType); err != nil { log.Fatalf("Fail to dump database: %v", err) } |