Crates.io | pg_migrate |
lib.rs | pg_migrate |
version | 0.1.2 |
source | src |
created_at | 2024-07-01 12:20:20.489541 |
updated_at | 2024-07-07 18:30:42.527717 |
description | Database migration tool for PostgreSQL |
homepage | |
repository | https://github.com/allelementary/pg-migrate |
max_upload_size | |
id | 1288688 |
size | 73,368 |
Database migration tool for PostgreSQL written in Rust
cargo install pg_migrate
Set up the database URL and migrations directory in the environment variables DATABASE_URL
and MIGRATION_DIR
.
DATABASE_URL=postgresql://username:password@localhost/dbname
pg_migrate_cli new <migration name>
Upgrade / Downgrade: There is multiple options to upgrade or downgrade the database:
pg_migrate_cli upgrade head
pg_migrate_cli upgrade/downgrade migration-id <migration-id>
pg_migrate_cli upgrade/downgrade number <number>
Get head:
pg_migrate_cli head
pg_migrate_cli current
pg_migrate_cli history