No project description provided
Project description
pilgrimor
Database migration tool with versioning for python projects
Installation:
with pip
pip install pilgrimor
with poetry
poetry add pilgrimor
Usage:
Main commands:
initdb
- create technical migrations table.apply
- apply new migrations.apply —-version <version number>
- apply new migrations with version.rollback —-version <version number>
- rollback migrations to version inclusive.rollback —-latest
- rollback to latest version.
Necessary things
You need to specify some fields in your pyproject.toml
[tool.pilgrimor]
migrations_dir = "./migrations/"
database_engine = "PSQL"
env_file = "./.env"
migrations_dir - folder with migrations database_engine - there is only one database engine PSQL env_file = path to .env file
Migration file structure:
Migration file contains two blocks - apply and rollback with sql commands. For example:
—- apply —-
SQL CODE
—- rollback —-
SQL CODE
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
pilgrimor-0.1.1.tar.gz
(13.0 kB
view hashes)
Built Distribution
pilgrimor-0.1.1-py3-none-any.whl
(17.6 kB
view hashes)
Close
Hashes for pilgrimor-0.1.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6bcda2377bfd96530474bda8ea3915b0064826859e935ba183f60a6f967ae25c |
|
MD5 | 0c9a77800d5642eb58f219e5c0d96565 |
|
BLAKE2b-256 | 0442127cc4a525dce47405cfc6784a01295a4609c259cfcd73a8d82d561c6431 |