2.2.3 • Published 8 years ago
dbmigrations v2.2.3
Database migrations.
Usage
Install globally:
npm install dbmigrations -g...or in your project (doesn't need to be nodejs):
npm install dbmigrations --save-devCreate ./migrations directory:
mkdir migrationsCreate migration file:
dbmigrations create --name create_usersRun migration against database:
dbmigrations migrate --url postgres://localhost/testPasswords can be read from ~/.pgpass file.
You can also create js-based migration file with --js flag.
Use dbmigrations --help or dbmigrations migrate --help for sub-commands to get more info.
Configuration
You can create ./.dbmigrations.json configuration file. You can define environments (a list of urls):
{
"envs": {
"dev": [
"postgres://localhost/test1",
"postgres://localhost/test2"
],
"staging": [
"postgres://staging/test1",
"postgres://staging/test2"
]
}
}To run migrations for all databases defined in environment use:
dbmigrations migrate --env devNotes
- currently only postgres is supported
- currently there's no support for down-migrating
If you're interested in any of those (or you think something else is missing) please create an issue or pull request.
License
MIT
