No-frills migration utility for postgres
No-frills migration utility for PostgreSQL and SQLite.
go get github.com/matthewmueller/migrate
Usage:
migrate [<flags>] <command> [<args> ...]
Flags:
-h, --help Output usage information.
--dir="./migrate" migrations directory
--table="migrate" table name
--db=DB database url (e.g. 'postgres://localhost:5432/db')
Commands:
help Show help for a command.
new create a new migration
up migrate up
down migrate down
reset reset all down then up migrations
redo redo the last migration
info info on the current migration
The tests depend on a local PostgreSQL database being present. Make sure you have PostgreSQL installed and then run the following from your terminal:
createdb migrate-test
Then you should be able to run:
make test
MIT