Documentation
¶
Index ¶
- Variables
- func Create(name, dir string) (string, error)
- func Down(driver, conn, dir string) (name string, err error)
- func DownAll(driver, conn, dir string) (int, error)
- func DownAllDB(db *sql.DB, dir string) (int, error)
- func DownDB(db *sql.DB, dir string) (name string, err error)
- func IsNoMigrationError(err error) bool
- func Redo(driver, conn, dir string) (string, error)
- func RedoDB(db *sql.DB, dir string) (string, error)
- func SetDialect(d string) error
- func Status(driver, conn, dir string) (status, error)
- func StatusDB(db *sql.DB, dir string) (status, error)
- func Up(driver, conn, dir string) (int, error)
- func UpDB(db *sql.DB, dir string) (int, error)
- func UpOne(driver, conn, dir string) (name string, err error)
- func UpOneDB(db *sql.DB, dir string) (name string, err error)
- func Version(driver, conn string) (int64, error)
- func VersionDB(db *sql.DB) (int64, error)
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrNoCurrentVersion = errors.New("no current version found") ErrNoNextVersion = errors.New("no next version found") )
View Source
var Log io.Writer
Functions ¶
func DownAll ¶
DownAll rolls back all migrations. Logs success messages to global writer variable Log.
func DownAllDB ¶
DownAllDB rolls back all migrations. Logs success messages to global writer variable Log. Expects SetDialect to be called beforehand.
func IsNoMigrationError ¶
IsNoMigrationError returns true if the error type is of errNoMigration, indicating that there is no migration to run
func SetDialect ¶
SetDialect sets the current driver dialect for all future calls to the library.
func StatusDB ¶
StatusDB returns the status of each migration Expects SetDialect to be called beforehand
func UpDB ¶
UpDB migrates to the highest version available Expects SetDialect to be called beforehand.
Types ¶
This section is empty.
Source Files
¶
Click to show internal directories.
Click to hide internal directories.