migrator

package module
v0.0.0-...-2ce60bf Latest Latest
Warning

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

Go to latest
Published: Oct 5, 2014 License: MIT Imports: 6 Imported by: 2

README

Migrator is a simple framework for running and maintaing database migrations in Go. If you're looking for a full-featured migration framework, look elsewhere, as Migrator is kept intentionally simple.

Usage


package main

import (
    "github.com/kyleconroy/migrator"
)

func main() {
    err := migrator.Run(db, "migrations")
}

How it Works

Migrator creates a migrations table in the database, in which it keeps track of what migrations have been run. Migrations are just SQL files stored in a directory. The migration order is determined by the putting all the SQL filenames into a slice and using sort.String.

Development

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Run

func Run(db *sql.DB, path string) error

Types

This section is empty.

Jump to

Keyboard shortcuts

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