Node.js database migration management built exclusively for postgres. (But can also be used for other DBs conforming to SQL standard - e.g. CockroachDB.) Started by Theo Ephraim, now maintained by Salsita Software. Installing this module adds a runnable file into your node_modules/.bin directory. If installed globally (with the -g option), you can run node-pg-migrate and if not, you can run ./node_modules/.bin/node-pg-migrate. Add "migrate": "node-pg-migrate" to scripts section of package.json so you are able to quickly run commands. Run npm run migrate create my first migration. It will create file xxx_my-first-migration.js in migrations folder. Now you should put your DB connection string to DATABASE_URL environment variable and run npm run migrate up. (e.g. DATABASE_URL=postgres://test:test@localhost:5432/test npm run migrate up).
Features
- Everything is async in node
- Licensed under the MIT License (MIT)
- Save migration files
- Built exclusively for postgres
- Quickly run command
- Full docs are available