dynamodb-migrations-tool
TypeScript icon, indicating that this package has built-in type declarations

1.1.0 • Public • Published

dynamodb-migrations-tool Build Status Coverage Status npm version

The dynamodb-migrations-tool is a DynamoDB storage based migrator implemented on top of the relyable and well tested framework agnostic migration tool umzug.

Installation

npm install dynamodb-migrations-tool --save

Usage

The following example demonstrate a minimal usage of the migrator:

const {defaultMigrator} = require('dynamodb-migrations-tool');
 
(async () => {
  // checks migrations and run them if they are not already applied
  await defaultMigrator.up();
  console.log('All migrations performed successfully');
})();

Using example bellow you can create a migrator instance with a couple migratorOptions:

const {migratorFactory} = require('dynamodb-migrations-tool');
 
const migrator = migratorFactory({
  migrationTable: 'migrations' // default
});
 
(async () => {
  await migrator.up();
})();

Migrator Options

The possible migratorOptions are:

{
  // The configured DynamoDB DocumentClient instance from aws-sdk.
  // Optional. If omited it will be created with default aws-sdk config.
  dynamodb: DynamoDB.DocumentClient,
 
  // Custom DynamoDB migration table name, can be populated with stage and stuff.
  // Optional. Default value is `migrations`.
  migrationTable: String,
}

/dynamodb-migrations-tool/

    Package Sidebar

    Install

    npm i dynamodb-migrations-tool

    Weekly Downloads

    1

    Version

    1.1.0

    License

    MIT

    Unpacked Size

    15 kB

    Total Files

    14

    Last publish

    Collaborators

    • f1oyd