@hjertnes/mig
v0.0.3
Published
A dead simple sql migration tool for postgres
Downloads
6
Readme
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