Get unlimited public & private packages + package-based permissions with npm Pro.Get started »

pigmig

0.0.1 • Public • Published

pigmig

Pigmig is a postgresql database migration tool. It has a minimal feature-set.

  1. Pigmig creates a migrations table if one does not already exist.
  2. Pigmig verifies the checksums of previously ran migrations, throwing an error and exiting on failure.
  3. Pigmig runs new migrations, adding them to the migrations table on success.

Your responsibilities

  1. Set process.env.DATABASE_URL
  2. Store (only) .sql scripts in a migrations folder
    • Ensure they will be ordered correctly by the filesystem, e.g., 001.setup.sql, 002.other.sql, ...
  3. Do not have a migrations table

Usage

import { resolve } from 'path'
import { migrate } from 'pigmig'
 
await migrate(resolve('src/db/migrations'))

Install

npm i pigmig

DownloadsWeekly Downloads

1

Version

0.0.1

License

MIT

Unpacked Size

28.5 kB

Total Files

24

Last publish

Collaborators

  • avatar