migrate: github.com/gemnasium/migrate/migrate Index | Files | Directories

package migrate

import "github.com/gemnasium/migrate/migrate"

Package migrate is imported by other Go code. It is the entry point to all migration functions.


Package Files


func Create Uses

func Create(url, migrationsPath, name string) (*file.MigrationFile, error)

Create creates new migration files on disk.

func Down Uses

func Down(pipe chan interface{}, url, migrationsPath string)

Down rolls back all migrations.

func DownSync Uses

func DownSync(url, migrationsPath string) (err []error, ok bool)

DownSync is synchronous version of Down().

func Graceful Uses

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 Migrate Uses

func Migrate(pipe chan interface{}, url, migrationsPath string, relativeN int)

Migrate applies relative +n/-n migrations.

func MigrateSync Uses

func MigrateSync(url, migrationsPath string, relativeN int) (err []error, ok bool)

MigrateSync is synchronous version of Migrate().

func NewPipe Uses

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 Uses

func NonGraceful()

NonGraceful disables interrupts checking. The first received ^C will stop execution immediately.

func Redo Uses

func Redo(pipe chan interface{}, url, migrationsPath string)

Redo rolls back the most recently applied migration, then runs it again.

func RedoSync Uses

func RedoSync(url, migrationsPath string) (err []error, ok bool)

RedoSync is synchronous version of Redo().

func Reset Uses

func Reset(pipe chan interface{}, url, migrationsPath string)

Reset runs the down and up migration function.

func ResetSync Uses

func ResetSync(url, migrationsPath string) (err []error, ok bool)

ResetSync is synchronous version of Reset().

func Up Uses

func Up(pipe chan interface{}, url, migrationsPath string)

Up applies all available migrations.

func UpSync Uses

func UpSync(url, migrationsPath string) (err []error, ok bool)

UpSync is synchronous version of Up().

func Version Uses

func Version(url, migrationsPath string) (version file.Version, err error)

Version returns the current migration version.

func Versions Uses

func Versions(url, migrationsPath string) (versions file.Versions, err error)

Versions returns applied versions.


directionPackage direction just holds convenience constants for Up and Down migrations.

Package migrate imports 12 packages (graph) and is imported by 11 packages. Updated 2017-01-25. Refresh now. Tools for package owners.