mirror of
https://github.com/Fluffy-Bean/TastyBites.git
synced 2025-06-23 18:26:16 +00:00
Improve migrate command
This commit is contained in:
parent
2f40cdcd64
commit
2bde65c5a2
3 changed files with 70 additions and 14 deletions
|
@ -12,6 +12,7 @@ func migrate(flags []string) {
|
|||
cmd := flag.NewFlagSet("migrate", flag.ExitOnError)
|
||||
|
||||
downgrade := cmd.Bool("downgrade", false, "Downgrade Database")
|
||||
confirm := cmd.Bool("y", false, "Skip questioning")
|
||||
|
||||
err := cmd.Parse(flags)
|
||||
if err != nil {
|
||||
|
@ -19,7 +20,7 @@ func migrate(flags []string) {
|
|||
os.Exit(1)
|
||||
}
|
||||
|
||||
err = db.Migrate(!*downgrade)
|
||||
err = db.Migrate(*downgrade, *confirm)
|
||||
if err != nil {
|
||||
fmt.Println(err)
|
||||
os.Exit(1)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue