mirror of
https://codeberg.org/davrot/forgejo.git
synced 2025-07-08 01:00:03 +02:00
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
This commit is contained in:
parent
70900bd167
commit
980dd0bf51
54 changed files with 3135 additions and 2619 deletions
14
cmd/dump.go
14
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)
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue