| Crates.io | fly-migrate |
| lib.rs | fly-migrate |
| version | 0.2.1 |
| created_at | 2023-03-29 12:34:10.308218+00 |
| updated_at | 2024-03-23 13:29:14.252288+00 |
| description | A simple CLI database migration tool for postgresql. |
| homepage | |
| repository | https://github.com/mjhoy/fly |
| max_upload_size | |
| id | 824078 |
| size | 57,135 |
A simple CLI database migration tool for postgresql. Very much work-in-progress at the moment.
Available on crates.io as fly-migrate:
$ cargo install fly-migrate
# installs `fly` to `~/.cargo/bin`:
$ fly --help
Fly expects the following env variables set. It will also use dotenv
to look in a .env file.
MIGRATE_DIR: Path to your migrations (e.g., db/migrate).PG_USERPG_PASSWORD (optional)PG_HOSTPG_PORTPG_DBYou can use the example-env subcommand to output an example .env
file to get started:
fly example-env >> .env
You can also directly set a PG_CONNECTION_STRING instead of the
individual PG_ variables.
up: Applies all pending migrations.down: Rolls back the last migration.status: Prints the current status of the database.new: Creates a new migration file.example-env: Outputs an example .env file.Testing fly requires a postgres connection. You should set the
following env variables:
TEST_PG_HOST=host
TEST_PG_PORT=port
TEST_PG_USER=user
You can put these in a .env.test in the root directory.