Documentation ¶
Overview ¶
Package migrate is imported by other Go code. It is the entry point to all migration functions.
Index ¶
- func Create(url, migrationsPath, name string) (*file.MigrationFile, error)
- func Down(pipe chan interface{}, url, migrationsPath string)
- func DownSync(url, migrationsPath string) (err []error, ok bool)
- func Graceful()
- func Migrate(pipe chan interface{}, url, migrationsPath string, relativeN int)
- func MigrateSync(url, migrationsPath string, relativeN int) (err []error, ok bool)
- func NewPipe() chan interface{}
- func NonGraceful()
- func Redo(pipe chan interface{}, url, migrationsPath string)
- func RedoSync(url, migrationsPath string) (err []error, ok bool)
- func Reset(pipe chan interface{}, url, migrationsPath string)
- func ResetSync(url, migrationsPath string) (err []error, ok bool)
- func Up(pipe chan interface{}, url, migrationsPath string)
- func UpSync(url, migrationsPath string) (err []error, ok bool)
- func Version(url, migrationsPath string) (version uint64, err error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Create ¶
func Create(url, migrationsPath, name string) (*file.MigrationFile, error)
Create creates new migration files on disk
func Down ¶
func Down(pipe chan interface{}, url, migrationsPath string)
Down rolls back all migrations
func Graceful ¶
func Graceful()
Graceful enables interrupts checking. Once the first ^C is received it will finish the currently running migration and abort execution of the next migration. If ^C is received twice, it will stop execution immediately.
func MigrateSync ¶
MigrateSync is synchronous version of Migrate
func NewPipe ¶
func NewPipe() chan interface{}
NewPipe is a convenience function for pipe.New(). This is helpful if the user just wants to import this package and nothing else.
func NonGraceful ¶
func NonGraceful()
NonGraceful disables interrupts checking. The first received ^C will stop execution immediately.
func Redo ¶
func Redo(pipe chan interface{}, url, migrationsPath string)
Redo rolls back the most recently applied migration, then runs it again.
func Reset ¶
func Reset(pipe chan interface{}, url, migrationsPath string)
Reset runs the down and up migration function
func Up ¶
func Up(pipe chan interface{}, url, migrationsPath string)
Up applies all available migrations
Types ¶
This section is empty.