migrate

package
v0.9.0 Latest Latest
Warning

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

Go to latest
Published: Jun 15, 2015 License: BSD-2-Clause 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 string)

Down rolls back all migrations

func DownSync

func DownSync(url, migrationsPath 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 string, relativeN int)

Migrate applies relative +n/-n migrations

func MigrateSync

func MigrateSync(url, migrationsPath 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 string)

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

func RedoSync

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

RedoSync is synchronous version of Redo

func Reset

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

Reset runs the down and up migration function

func ResetSync

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

ResetSync is synchronous version of Reset

func Up

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

Up applies all available migrations

func UpSync

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

UpSync is synchronous version of Up

func Version

func Version(url, migrationsPath 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