1.0.7 • Published 8 years ago

dynamo-migrate v1.0.7

Weekly downloads
2
License
MIT
Repository
github
Last release
8 years ago

dynamo-migrate

Migration tool for AWS DynamoDB

Installation

npm install dynamo-migrate

Configuration

You need to setup some env var

  • DYNAMOPREFIX=env_project (prefix for your table)
  • AWS_ACCESS_KEY_ID=AKXXXXXXXXXXXXXXXXX
  • AWS_SECRET_ACCESS_KEY=XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

You can override those env var

It it strongly suggested to add a npm task in your project

"scripts": { "migration": "./node_modules/dynamo-migrate/bin/migrate" }

If you want to use ES6 syntax for migrations

"scripts": { "migration": "babel-node ./node_modules/dynamo-migrate/bin/migrate" }

Commands

Create

npm run migration -- create "create country table"

Create a new incremental migration 001-create-country-table.js

Up

npm run migration -- up

Migrate up all new migrations since the last migration executed

npm run migration -- up 002-add-country

Migrate up the given migration

Down

npm run migration -- down 002-add-country

Migrate dowm the given migration

List

npm run migration -- list

List all the migrations on the remote server and when they have been run

Require external modules

If you want to use external modules, you can use the --require option, The command below will require babel-register from the main project to be able to use ES6 into your migrations files

npm run migration -- up -r "babel-register" 002-add-country

License

(The MIT License)

Copyright (c) 2016 Maple Inside

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the 'Software'), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

1.0.7

8 years ago

1.0.6

8 years ago

1.0.5

8 years ago

1.0.4

8 years ago

1.0.3

8 years ago

1.0.2

8 years ago

1.0.1

8 years ago

1.0.0

8 years ago