cmd

package
v0.5.3 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 14, 2020 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	Driver = &cli.StringFlag{
		Name:       "db-driver",
		Aliases:    []string{"d"},
		Usage:      "database driver one of (postgres,mysql)",
		EnvVars:    []string{"DB_DRIVER"},
		Value:      pg,
		Required:   true,
		HasBeenSet: true,
	}
	To = &cli.UintFlag{
		Name:    "to",
		Aliases: []string{"t"},
		Usage:   "on what element to migrate",
	}
	Operation = &cli.StringFlag{
		Name:     "operation",
		Aliases:  []string{"o"},
		Usage:    fmt.Sprintf("migration command one of (%s,%s,%s,%s,%s,%s)", core.Up, core.UpTo, core.UpOne, core.Down, core.DownTo, core.Reset),
		Required: true,
	}
	Dir = &cli.StringFlag{
		Name:    "dir",
		Aliases: []string{"D"},
		Usage:   "migration file location",
	}
	Name = &cli.StringFlag{
		Name:       "db-name",
		Aliases:    []string{"n"},
		Usage:      "database name",
		EnvVars:    []string{"DB_NAME"},
		Value:      zergrepo.DBName,
		Required:   true,
		HasBeenSet: true,
	}
	User = &cli.StringFlag{
		Name:       "db-user",
		Aliases:    []string{"u"},
		Usage:      "database user",
		EnvVars:    []string{"DB_USER"},
		Value:      zergrepo.DBUser,
		Required:   true,
		HasBeenSet: true,
	}
	Pass = &cli.StringFlag{
		Name:       "db-pass",
		Aliases:    []string{"p"},
		Usage:      "database password",
		EnvVars:    []string{"DB_PASS"},
		Value:      zergrepo.DBPassword,
		Required:   true,
		HasBeenSet: true,
	}
	Host = &cli.StringFlag{
		Name:       "db-host",
		Aliases:    []string{"H"},
		Usage:      "database host",
		EnvVars:    []string{"DB_HOST"},
		Value:      zergrepo.DBHost,
		Required:   true,
		HasBeenSet: true,
	}
	Port = &cli.IntFlag{
		Name:       "db-port",
		Aliases:    []string{"P"},
		Usage:      "database port",
		EnvVars:    []string{"DB_PORT"},
		Value:      zergrepo.DBPort,
		Required:   true,
		HasBeenSet: true,
	}
	MigrateName = &cli.StringFlag{
		Name:     "migrate-name",
		Aliases:  []string{"M"},
		Usage:    "migration file name",
		Required: true,
	}
)
View Source
var (
	ErrUnknownOperation = errors.New("unknown Operation")
	ErrUnknownDriver    = errors.New("unknown Driver")
)
View Source
var Migrate = &cli.Command{
	Name:         "migrate",
	Usage:        "exec migrate",
	Description:  "Migrate the DB To the most recent version available",
	BashComplete: cli.DefaultAppComplete,
	Before:       beforeMigrateAction,
	After:        afterMigrateAction,
	Action:       migrateAction,
	Flags:        dbFlags,
}
View Source
var NewMigrate = &cli.Command{
	Name:         "create",
	Usage:        "create migrate file",
	Description:  "Creates a new migration file with test data.",
	BashComplete: cli.DefaultAppComplete,
	Action:       newMigrateAction,
	Flags:        []cli.Flag{MigrateName, Dir},
}
View Source
var Version = &cli.Command{
	Name:         "version",
	Usage:        "get version",
	Description:  "getting application version",
	BashComplete: cli.DefaultAppComplete,
	Action:       actionVersion,
}

Functions

This section is empty.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL