@firstclasspostcodes/migrations

0.0.3 • Public • Published

Migrations

Run and manage migrations using the RDS HTTP Data API. Migrations are executed only once and sequential order.

This small library provides a CLI that can be configured using a configuration file, environment variables or command line flags.

Installation

The CLI can be installed globally, using:

npm i -g @firstclasspostcodes/migrations

or can be executed using npx:

npx @firstclasspostcodes/migrations

Usage

Create a folder named migrations/ in your working directory.

You'll need to name your migrations in the following format: YYYYMMDD-name-of-migration.sql.

The CLI accepts configuration using a .migrationrc file with the following keys:

{
  "database": "name_of_your_database",
  "resource": "arn-of-your-aws-rds-resource",
  "secret": "arn-of-your-aws-secrets-manager-secret",
  "migrations": {
    "dir": "migrations/"
  }
}

You can also use the following environment variables:

Name Alternative
DB_NAME DATABASE_NAME
DB_RESOURCE_ARN DATABASE_RESOURCE_ARN
DB_SECRET_ARN DATABASE_SECRET_ARN

If you provide any command-line flags, all of the aforementioned configuration values are overridden:

Flag Shorthand
---database -d, -D
---resource -r, -R
---secret -s, -S
---migrations-dir -m, -M

Readme

Keywords

none

Package Sidebar

Install

npm i @firstclasspostcodes/migrations

Weekly Downloads

0

Version

0.0.3

License

ISC

Unpacked Size

18.5 kB

Total Files

19

Last publish

Collaborators

  • davidkelley