migrate

package
v1.3.0 Latest Latest
Warning

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

Go to latest
Published: Dec 5, 2016 License: MIT Imports: 11 Imported by: 0

Documentation

Overview

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

Index

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, migrationType string)

Down rolls back all migrations

func DownSync

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

DownSync is synchronous version of Down

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 Migrate

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

Migrate applies relative +n/-n migrations

func MigrateSync

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

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, migrationType string)

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

func RedoSync

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

RedoSync is synchronous version of Redo

func Reset

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

Reset runs the down and up migration function

func ResetSync

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

ResetSync is synchronous version of Reset

func Up

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

Up applies all available migrations

func UpSync

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

UpSync is synchronous version of Up

func Version

func Version(url, migrationsPath, migrationType string) (version uint64, err error)

Version returns the current migration version

Types

This section is empty.

Directories

Path Synopsis
Package direction just holds convenience constants for Up and Down migrations.
Package direction just holds convenience constants for Up and Down migrations.

Jump to

Keyboard shortcuts

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