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.2.tar.gz
(13.0 kB
view hashes)
Built Distribution
pilgrimor-0.1.2-py3-none-any.whl
(17.6 kB
view hashes)
Close
Hashes for pilgrimor-0.1.2-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 963b4b6e1f069926d2a9699f08bc28f1508a1f9fa61952cc64b790ef0bab7e7d |
|
MD5 | 48690143b8a47bbbebf685fc12536d97 |
|
BLAKE2b-256 | 1bef9da1eab14c74df95af88ad2ec6f60751277aa5a910ef4cb797b5043fd63f |