package main

import "github.com/urfave/cli/v2"

var standardFlags = []cli.Flag{dsnFlag, driverFlag, sourceFlag, fileFlag, timeoutFlag}

var commands []*cli.Command = []*cli.Command{
	&cli.Command{
		Name:                   "create",
		Usage:                  "Create a new migration",
		UsageText:              "",
		Description:            "",
		ArgsUsage:              "",
		Category:               "",
		SkipFlagParsing:        false,
		HideHelp:               false,
		HideHelpCommand:        false,
		Hidden:                 false,
		UseShortOptionHandling: false,
		HelpName:               "",
		CustomHelpTemplate:     "",
		Flags:                  []cli.Flag{},
		Action:                 CreateAction,
	},
	&cli.Command{
		Name:                   "up",
		Usage:                  "Apply all up migrations ",
		UsageText:              "migrate up [optional flags] $DSN",
		Description:            "",
		ArgsUsage:              "",
		Category:               "",
		SkipFlagParsing:        false,
		HideHelp:               false,
		HideHelpCommand:        false,
		Hidden:                 false,
		UseShortOptionHandling: false,
		HelpName:               "",
		CustomHelpTemplate:     "",
		Flags:                  standardFlags,
		Action:                 UpAction,
		Before:                 validateDSN,
	},
	&cli.Command{
		Name:                   "down",
		Usage:                  "Apply all down migrations",
		UsageText:              "migrate down [optional flags] $DSN",
		Description:            "",
		ArgsUsage:              "",
		Category:               "",
		SkipFlagParsing:        false,
		HideHelp:               false,
		HideHelpCommand:        false,
		Hidden:                 false,
		UseShortOptionHandling: false,
		HelpName:               "",
		CustomHelpTemplate:     "",
		Flags:                  standardFlags,
		Action:                 DownAction,
		Before:                 validateDSN,
	},
	&cli.Command{
		Name:                   "drop",
		Usage:                  "Drop all schemas in the database",
		UsageText:              "migrate drop [optional flags] $DSN",
		Description:            "",
		ArgsUsage:              "DSN = data source name of your database.",
		Category:               "",
		SkipFlagParsing:        false,
		HideHelp:               false,
		HideHelpCommand:        false,
		Hidden:                 false,
		UseShortOptionHandling: false,
		HelpName:               "",
		CustomHelpTemplate:     "",
		Flags:                  standardFlags,
		Action:                 DropAction,
		Before:                 validateDSN,
	},
	&cli.Command{
		Name:                   "dump",
		Usage:                  "Dump a schema.",
		UsageText:              "migrate dump [optional flags] $DSN",
		Description:            "",
		ArgsUsage:              "",
		Category:               "",
		SkipFlagParsing:        false,
		HideHelp:               false,
		HideHelpCommand:        false,
		Hidden:                 false,
		UseShortOptionHandling: false,
		HelpName:               "",
		CustomHelpTemplate:     "",
		Flags:                  standardFlags,
		Action:                 CreateAction,
		Before:                 validateDSN,
	},
}
