migration

package
v0.0.0-...-0cf49f2 Latest Latest
Warning

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

Go to latest
Published: Dec 17, 2015 License: BSD-3-Clause Imports: 6 Imported by: 0

Documentation

Overview

Package migration provides a "micro-framework" for migration management: each migration is a simple function that returns an error. All migration functions are executed in the order they were registered.

Index

Constants

This section is empty.

Variables

View Source
var ErrDuplicateMigration = errors.New("there's already a migration with this name")

ErrDuplicateMigration is the error returned by Register when the given name is already in use.

Functions

func Register

func Register(name string, fn MigrateFunc) error

Register register a new migration for later execution with the Run functions.

func Run

func Run(w io.Writer, dry bool) error

Run runs all registered migrations. Migrations are executed in the order that they were registered.

Types

type MigrateFunc

type MigrateFunc func() error

MigrateFunc represents a migration function, that can be registered with the Register function. Migrations are later ran in the registration order, and this package keeps track of which migrate have ran already.

Jump to

Keyboard shortcuts

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