migrate

package
v0.0.0-...-69ea562 Latest Latest
Warning

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

Go to latest
Published: Feb 11, 2014 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Change_20150209

type Change_20150209 struct{}

func (Change_20150209) Down

func (Change_20150209) Down(tx *sql.Tx) error

func (Change_20150209) Revision

func (Change_20150209) Revision() int64

func (Change_20150209) Up

func (Change_20150209) Up(tx *sql.Tx) error

type Migration

type Migration struct {
	// contains filtered or unexported fields
}

func New

func New(db *sql.DB) *Migration

func (*Migration) Add

func (m *Migration) Add(rev ...Revision) *Migration

Add the Revision to the list of migrations.

func (*Migration) Migrate

func (m *Migration) Migrate() error

Execute the full list of migrations.

func (*Migration) MigrateTo

func (m *Migration) MigrateTo(target int64) error

Execute all database migration until you are at the specified revision number. If the revision number is less than the current revision, then we will downgrade.

type Revision

type Revision interface {
	Up(tx *sql.Tx) error
	Down(tx *sql.Tx) error
	Revision() int64
}

Jump to

Keyboard shortcuts

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