pgroll is a thread-safe, lightweight and flexible database migration tool for PostgreSQL
PostgreSQL clients currently supporting:
- PostgresJS
- pg
- ...
postgresjs client. It offers simple commands to manage your database schema changes with up, down, create, and go features.
- up: Apply all pending migrations.
- down: Rollback the last applied migration.
- create: Create new migration files.
- go: Migrate the database schema to a specific version.
You can install pgroll via npm:
npm install pgrollpgroll provides a CLI to manage your database migrations. Below are the available commands:
- Run Migrations Up:
npx pgroll up- Run Migrations Down:
npx pgroll down- Navigate to a Specific Version:
npx pgroll go <version>- Create New Migration Files:
npx pgroll create <migration-name>