migrate

No-frills migration utility for postgres

Stars
3

migrate

No-frills migration utility for PostgreSQL and SQLite.

Features

  • Stable and in use across 10+ projects over 3 years.
  • Supports migrations from a virtual file-system
  • Supports several SQLite3 modules (full-text search, json, foreign keys, etc.)

Installation

go get github.com/matthewmueller/migrate

Usage

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

Help Wanted

  • Generic driver interface

Authors

Running Tests

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

License

MIT

Package Rankings
Top 8.17% on Proxy.golang.org