Socket
Socket
Sign inDemoInstall

@digitalspace/dynamodb-migrate

Package Overview
Dependencies
39
Maintainers
3
Versions
4
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    @digitalspace/dynamodb-migrate

Scripts for migrations for DynamoDB


Version published
Weekly downloads
31
increased by24%
Maintainers
3
Created
Weekly downloads
 

Readme

Source

Database Migrations

A simple DynamoDB database migration tool is included in the /dynamodb-migrate directory. This tool can be used to create and apply data migration scripts.

package.json configuration

Add the following to scripts:

"migration": "node ./node_modules/@digitalspace/dynamodb-migrate/migrate.js"

Create new migration

migration create command can be used to generate a blank migration script. <migration-name> is required.

npm run migration create <migration-name>

Apply migrations

migration up command can be used to apply new migrations to the target database. The default migration up command will target local DynamoDB on port 8000. The port can be overriden with the DYNAMODB_ENDPOINT env. See AWS DynamoDB remote endpoints to configure which region you want to target.

migration up remote can be used to target remote AWS databases. This will require the proper AWS credentials in the environments.

# Targeting dynamodb-local
npm run migration up

# Targeting remote AWS DynamoDB
npm run migration up remote

Configuration

You can configure the script by using environment variables. The following are the environment variables that the script is looking for:

  • MIGRATIONS_DB_REGION
  • MIGRATIONS_DB_ENDPOINT
  • MIGRATIONS_TABLE_NAME
  • MIGRATIONS_DIR
  • MIGRATIONS_TEMPLATE
  • DATE_FORMAT

FAQs

Last updated on 10 Mar 2023

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc