0.0.3 • Published 6 years ago

@hjertnes/mig v0.0.3

Weekly downloads
-
License
MIT
Repository
-
Last release
6 years ago

pg-mig

A dead simple tool to manage PostgreSQL database migrations

This is a very simple tool to manage database migrations. No code required, just install it through npm and use the commands belov to get started.

If you are looking for a way to generate SQL from code, then keep looking, this is just a simple command to manage migrations you write yourself.

Commands

mig init - run this to get everything set up in your project. You also need to configure your database configuration before you do anything. See the Configration section of this document.

mig add - run this to add a new migration. It will be placed in the "migrations" folder.

mig test - run this to test your migiration; it will create a new schema in your database, run the migrations, and then delete it.

mig migrate - run this to apply the migrations to your database

Configuration

You need to set a database connection string like this one postgres://username:password@host:5432/database either in the .dbconfig file or a enviornment variable called DBCONFIG.

NPM Package: https://www.npmjs.com/package/@hjertnes/mig