Registry / database / dynamo-migrate

dynamo-migrate

JSON →
library1.0.7jsnpmunverified

Migration tool for AWS DynamoDB, version 1.0.7. It provides a simple CLI to create, apply, and revert database schema or data migrations stored as JavaScript files. Designed for Node.js >= 5.5.0 and uses environment variables for AWS credentials, table prefix, and DynamoDB endpoint. Differentiates from other DynamoDB migration tools by offering a lightweight, file-based approach with support for custom migration folders and table names, and optional babel-register for ES6 syntax. Release cadence appears low; package has not been updated recently.

database
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

The package exposes a CLI binary, not a library. Use the installed binary directly or via npm scripts.

./node_modules/.bin/migrate create "name"

Install and run a migration: create, edit, apply up, and revert down.

npm install dynamo-migrate export DYNAMO_PREFIX=myapp_ export AWS_ACCESS_KEY_ID=${AWS_ACCESS_KEY_ID} export AWS_SECRET_ACCESS_KEY=${AWS_SECRET_ACCESS_KEY} export AWS_REGION=us-west-2 ./node_modules/.bin/migrate create "add users table" # then edit migrations/001-add-users-table.js export const up = async (DynamoDB) => { const params = { TableName: `${process.env.DYNAMO_PREFIX}users`, KeySchema: [{ AttributeName: 'id', KeyType: 'HASH' }], AttributeDefinitions: [{ AttributeName: 'id', AttributeType: 'S' }], ProvisionedThroughput: { ReadCapacityUnits: 5, WriteCapacityUnits: 5 } }; await DynamoDB.createTable(params).promise(); }; export const down = async (DynamoDB) => { await DynamoDB.deleteTable({ TableName: `${process.env.DYNAMO_PREFIX}users` }).promise(); }; ./node_modules/.bin/migrate up ./node_modules/.bin/migrate down 001-add-users-table
Debug
Known footguns
gotchaRequires AWS credentials via environment variables; not suitable for IAM roles or Lambda environments without additional setup.
breakingTable prefix is mandatory via DYNAMO_PREFIX; migrations table name is prefixed as well.
Upgrade
Version history

Breaking-change detection hasn't run for this library yet.

Audit
Security & dependencies

CVE tracking and dependency tree are planned for a later release.

Agent activity
9 hits · last 30 days
gptbot
3
ahrefsbot
1
Resources