volmigrate

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Aug 19, 2016 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Commands = []cli.Command{
	{
		Name:        "list",
		ArgsUsage:   "",
		Usage:       "Lists all schema migration versions",
		Description: "Produces a newline-delimited list of all available schema migration versions",
		Action:      ListMigrations,
	},
	{
		Name:        "run",
		ArgsUsage:   "[version]",
		Usage:       "Runs schema migrations",
		Description: "Runs one or all pending schema migrations",
		Action:      RunMigrations,
	},
	{
		Name:        "version",
		ArgsUsage:   "",
		Usage:       "See the current schema version",
		Description: "See the current schema version",
		Action:      ShowVersions,
	},
}

Commands is the data structure which describes the command hierarchy for volmigrate.

View Source
var GlobalFlags = []cli.Flag{
	cli.BoolFlag{
		Name:  "silent",
		Usage: "disables prompting before running migrations",
	},
	cli.StringFlag{
		Name:  "prefix",
		Usage: "prefix key used in etcd for namespacing",
		Value: "/volplugin",
	},
	cli.StringSliceFlag{
		Name:  "etcd",
		Usage: "URL for etcd",
		Value: &cli.StringSlice{"http://localhost:2379"},
	},
}

GlobalFlags are required global flags for the operation of volmigrate.

Functions

func ListMigrations

func ListMigrations(ctx *cli.Context)

ListMigrations returns a newline-delimited list of migration versions and their descriptions.

func RunMigrations

func RunMigrations(ctx *cli.Context)

RunMigrations runs either a single pending migration or all pending migrations. If no migrations need to be run, a message will state that nothing was performed.

func ShowVersions

func ShowVersions(ctx *cli.Context)

ShowVersions prints the current schema version and the newest version that's available.

Types

type Migration

type Migration struct {
	Version     int64  // each new migration increments this value, must be >= 1
	Description string // e.g., "volplugin 1.3 release"
	// contains filtered or unexported fields
}

Migration represents a migration that volmigrate can run.

func (*Migration) Run

func (m *Migration) Run(b backend.Backend) error

Run executes the migration using a supplied backend.Backend

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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