Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Stop killing your fingers typing migration versions

branch: master

Fetching latest commit…

Cannot retrieve the latest commit at this time

README.rdoc

Migrator

A simple command line tool for running migrations. Acts as a thin wrapper around rake db:migrate:up/down.

Features

  • Specify migrations by name (instead of by version),

  • Completion of migration names,

  • Migrate multiple environments

Usage

$ migrator <space separated list of environments>

Example

Without command line arguments the environments development and test are used:

$ migrator 
Target environements: development, test.
Choose a command: [m]igrate, migration [u]p, migration [d]own, [q]uit
> m
... runs rake db:migrate RAILS_ENV=development ...
... runs rake db:migrate RAILS_ENV=test ...

$ migrator 
Target environements: development, test.
Choose a command: [m]igrate, migration [u]p, migration [d]own, [q]uit
> u
Enter a migration name:
> create_posts
... runs rake db:migrate:up VERSION=xxx RAILS_ENV=development ...
... runs rake db:migrate:up VERSION=xxx RAILS_ENV=test ...

Just migrate the test database:

$ migrator test 
Target environements: test.
...

Install

Just place the migrator file somewhere in your PATH.

Something went wrong with that request. Please try again.