migrate

package
v1.4.1 Latest Latest
Warning

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

Go to latest
Published: May 19, 2024 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrInProduction = errors.New("application in production, use --force or -f to confirm")
)

Functions

func NewCmdFresh

func NewCmdFresh() *cobra.Command

NewCmdFresh returns new initialized instance of 'fresh' sub command.

func NewCmdMigrate

func NewCmdMigrate(db *gorm.DB, production bool) *cobra.Command

NewCmdMigrate returns new initialized instance of 'migrate' sub command.

func NewCmdRefresh

func NewCmdRefresh() *cobra.Command

NewCmdRefresh returns new initialized instance of 'refresh' sub command.

func NewCmdReset

func NewCmdReset() *cobra.Command

NewCmdReset returns new initialized instance of 'reset' sub command.

func NewCmdRollback

func NewCmdRollback() *cobra.Command

NewCmdRollback returns new initialized instance of 'rollback' sub command.

func NewCmdUp

func NewCmdUp() *cobra.Command

NewCmdUp returns new initialized instance of 'up' sub command.

Types

type FreshOptions

type FreshOptions struct {
	// Options
	*Options
}

FreshOptions is an option struct to support 'fresh' sub command.

func NewFreshOptions

func NewFreshOptions() *FreshOptions

NewFreshOptions returns an initialized FreshOptions instance.

func (*FreshOptions) Complete

func (o *FreshOptions) Complete(cmd *cobra.Command, args []string) error

Complete completes all the required options.

func (*FreshOptions) Run

func (o *FreshOptions) Run(args []string) error

Run executes a new sub command using the specified options.

func (*FreshOptions) Validate

func (o *FreshOptions) Validate(cmd *cobra.Command, args []string) error

Validate makes sure there is no discrepancy in command options.

type Options

type Options struct {
	DB         *gorm.DB
	Production bool
	Force      bool
}

Options is an option struct to support 'migrate' sub command.

func NewOptions

func NewOptions() *Options

NewOptions returns an initialized Options instance.

func (*Options) Migrator

func (o *Options) Migrator() *migrate.Migrator

type RefreshOptions

type RefreshOptions struct {
	// Options
	*Options
}

RefreshOptions is an option struct to support 'refresh' sub command.

func NewRefreshOptions

func NewRefreshOptions() *RefreshOptions

NewRefreshOptions returns an initialized RefreshOptions instance.

func (*RefreshOptions) Complete

func (o *RefreshOptions) Complete(cmd *cobra.Command, args []string) error

Complete completes all the required options.

func (*RefreshOptions) Run

func (o *RefreshOptions) Run(args []string) error

Run executes a new sub command using the specified options.

func (*RefreshOptions) Validate

func (o *RefreshOptions) Validate(cmd *cobra.Command, args []string) error

Validate makes sure there is no discrepancy in command options.

type ResetOptions

type ResetOptions struct {
	// Options
	*Options
}

ResetOptions is an option struct to support 'reset' sub command.

func NewResetOptions

func NewResetOptions() *ResetOptions

NewResetOptions returns an initialized ResetOptions instance.

func (*ResetOptions) Complete

func (o *ResetOptions) Complete(cmd *cobra.Command, args []string) error

Complete completes all the required options.

func (*ResetOptions) Run

func (o *ResetOptions) Run(args []string) error

Run executes a new sub command using the specified options.

func (*ResetOptions) Validate

func (o *ResetOptions) Validate(cmd *cobra.Command, args []string) error

Validate makes sure there is no discrepancy in command options.

type RollbackOptions

type RollbackOptions struct {
	// Options
	*Options
}

RollbackOptions is an option struct to support 'rollback' sub command.

func NewRollbackOptions

func NewRollbackOptions() *RollbackOptions

NewRollbackOptions returns an initialized RollbackOptions instance.

func (*RollbackOptions) Complete

func (o *RollbackOptions) Complete(cmd *cobra.Command, args []string) error

Complete completes all the required options.

func (*RollbackOptions) Run

func (o *RollbackOptions) Run(args []string) error

Run executes a new sub command using the specified options.

func (*RollbackOptions) Validate

func (o *RollbackOptions) Validate(cmd *cobra.Command, args []string) error

Validate makes sure there is no discrepancy in command options.

type UpOptions

type UpOptions struct {
	// Options
	*Options
}

UpOptions is an option struct to support 'up' sub command.

func NewUpOptions

func NewUpOptions() *UpOptions

NewUpOptions returns an initialized UpOptions instance.

func (*UpOptions) Complete

func (o *UpOptions) Complete(cmd *cobra.Command, args []string) error

Complete completes all the required options.

func (*UpOptions) Run

func (o *UpOptions) Run(args []string) error

Run executes a new sub command using the specified options.

func (*UpOptions) Validate

func (o *UpOptions) Validate(cmd *cobra.Command, args []string) error

Validate makes sure there is no discrepancy in command options.

Jump to

Keyboard shortcuts

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