migrate

package
v0.2.3 Latest Latest
Warning

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

Go to latest
Published: Dec 27, 2020 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrCouldNotFindConnection = errors.New("could not find connection by name")
	ErrNotEnoughArgs          = errors.New("not enough args, please specify direction p.e ox pop migrate up")
	ErrInvalidInstruction     = errors.New("invalid instruction for migrate command")
)

Functions

This section is empty.

Types

type MigrateDown

type MigrateDown struct {
	// contains filtered or unexported fields
}

func (MigrateDown) CommandName

func (mu MigrateDown) CommandName() string

func (*MigrateDown) Flags

func (mu *MigrateDown) Flags() *pflag.FlagSet

func (MigrateDown) Name

func (mu MigrateDown) Name() string

func (*MigrateDown) ParseFlags

func (mu *MigrateDown) ParseFlags(args []string)

func (*MigrateDown) RunMigrations

func (mu *MigrateDown) RunMigrations(ctx context.Context, root string, args []string) error

Run will run migrations on the current folder, it will look for the migrations folder and attempt to run the migrations using internal pop tooling

type MigrateUp

type MigrateUp struct {
	// contains filtered or unexported fields
}

func (MigrateUp) CommandName

func (mu MigrateUp) CommandName() string

func (*MigrateUp) Flags

func (mu *MigrateUp) Flags() *pflag.FlagSet

func (MigrateUp) Name

func (mu MigrateUp) Name() string

func (*MigrateUp) ParseFlags

func (mu *MigrateUp) ParseFlags(args []string)

func (*MigrateUp) RunMigrations

func (mu *MigrateUp) RunMigrations(ctx context.Context, root string, args []string) error

Run will run migrations on the current folder, it will look for the migrations folder and attempt to run the migrations using internal pop tooling

type Migrator

type Migrator interface {
	CommandName() string
	RunMigrations(ctx context.Context, root string, args []string) error
}

Migrator type allows to identify migration runner plugins.

type Plugin

type Plugin struct {
	// contains filtered or unexported fields
}

func (Plugin) HelpText

func (m Plugin) HelpText() string

HelpText resturns the help Text of build function

func (*Plugin) Name

func (m *Plugin) Name() string

func (*Plugin) ParentName

func (m *Plugin) ParentName() string

func (*Plugin) Receive

func (m *Plugin) Receive(plugins []plugins.Plugin)

func (*Plugin) Run

func (m *Plugin) Run(ctx context.Context, root string, args []string) error

func (*Plugin) SubcommandName

func (m *Plugin) SubcommandName() string

Jump to

Keyboard shortcuts

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