Split migrate and downgrade commands

Rename Pending to GetPending
This commit is contained in:
Michał Gdula 2024-05-07 12:47:44 +01:00
parent 2bde65c5a2
commit b8d9ded81e
4 changed files with 73 additions and 43 deletions

View file

@ -16,15 +16,18 @@ func Parse() {
run(os.Args[2:])
case "migrate":
migrate(os.Args[2:])
case "downgrade":
downgrade(os.Args[2:])
case "status":
status(os.Args[2:])
case "-h":
fallthrough
case "-help":
fmt.Println("Available commands are:")
fmt.Println(" run: starts the server")
fmt.Println(" migrate: migrates database")
fmt.Println(" status: checks if there are pending migrations")
fmt.Println(" run: starts the server")
fmt.Println(" migrate: migrates database")
fmt.Println(" downgrade: undoes database migrations")
fmt.Println(" status: checks if there are pending migrations")
fmt.Println("\nTo specific usages, run commandName -h")
default:
fmt.Println("Use -h or -help for usage")