PG Migrate
About
Database migration tool for PostgreSQL written in Rust.
Features
- Create migration
- Upgrade / Downgrade database
- Get current migration
- Get head migration
- Get migrations history
Installation
Set up the database URL in the environment variable DATABASE_URL.
DATABASE_URL=postgresql://username:password@localhost/dbname
CLI Usage
- Create migration:
-
Upgrade / Downgrade: There is multiple options to upgrade or downgrade the database:
- Upgrade to the latest migration:
- Upgrade / Downgrade to a specific migration by migration id:
- Upgrade / Downgrade by number of migrations:
- Upgrade to the latest migration:
-
Get head:
- Get current migration:
- Get migrations history