Migrei is a lightweight SQL migration library for PostgreSQL databases, currently at version 1.1.0. It provides a simple CLI to apply and rollback SQL migration scripts stored in a local folder. Unlike other migration tools, Migrei does not require a global installation and can be executed via npx. It automatically generates rollback statements, eliminating the need to write reverse queries. The library reads database connection details from a .env file and supports batch processing of migration files. Its release cadence is currently unknown as it's a newer project with limited releases.
npm install migreiNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Shows how to create a migration file, configure the database URL, and run the up command.
Ensure .env file exists in the current working directory with correct DATABASE_URL variable.
Rename migration files to follow the pattern: 001_*.sql, 002_*.sql, etc.
Place all migration SQL files in a folder named 'migrations' at the project root.
Create a .env file with DATABASE_URL=postgres://user:pass@host:port/db
Create a folder named 'migrations' in the current working directory.
Add .sql files to the ./migrations folder.
No dependency data recorded yet.