Documentation
¶
Index ¶
- Constants
- Variables
- func CreateCommand() *capp.Cmd
- func DownCommand() *capp.Cmd
- func HandleCreate(names []string) error
- func HandleDown(opt DownOption) error
- func HandleExec(opt ExecOption) error
- func HandleInit(opt InitOption) error
- func HandleShow(opt ShowOption) error
- func HandleSkip(opt SkipOption) error
- func HandleStatus() error
- func HandleUp(opt UpOption) error
- func InitCommand() *capp.Cmd
- func NewApp(name, version, description string) *capp.App
- func NewExecCommand() *capp.Cmd
- func NewShowCommand() *capp.Cmd
- func NewUpCommand() *capp.Cmd
- func SkipCommand() *capp.Cmd
- func StatusCommand() *capp.Cmd
- type DB
- type DownOption
- type ExecOption
- type InitOption
- type ShowOption
- type SkipOption
- type UpOption
Constants ¶
View Source
const TimeLayout = "2006-01-02 15:04:05"
Variables ¶
View Source
var ( // ShowVerbose flag ShowVerbose bool // ConfigFile path to the configuration file ConfigFile string )
Functions ¶
func DownCommand ¶
DownCommand rolls back the last migration or a specific one
func HandleSkip ¶
func HandleSkip(opt SkipOption) error
HandleSkip skips one or multi migration file(s)
func NewExecCommand ¶
NewExecCommand executes SQL statement or SQL file directly
func NewShowCommand ¶
NewShowCommand shows database information like tables or table schema
Types ¶
type DownOption ¶
DownOption represents the options for the down command
type ExecOption ¶
type ExecOption struct {
// SQL or sql-file to execute
SQLOrFile string
// Skip confirmation prompt
Yes bool
}
ExecOption represents options for the exec command
type InitOption ¶
type InitOption struct {
Drop bool
}
type ShowOption ¶
ShowOption represents options for the show command
type SkipOption ¶
type SkipOption struct {
FileNames []string
}
SkipOption skip migration file option
Click to show internal directories.
Click to hide internal directories.