Skip to main content

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

Release files for pilgrimor 0.1.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for pilgrimor 0.1.2
File Size Uploaded
pilgrimor-0.1.2.tar.gz 13.0 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for pilgrimor 0.1.2
File Interpreter ABI Platform
pilgrimor-0.1.2-py3-none-any.whl Python 3 none any Details

Total release size: 30.6 kB

Release files / pilgrimor-0.1.2.tar.gz

Download URL pilgrimor-0.1.2.tar.gz
Size 13.0 kB
Tags Source
SHA-256 checksum
How to use checksums
009deee207b8edb64e818ede7a96940d3ed18e37c69b179ca65ceb1662e94fd4
BLAKE2b-256 checksum
How to use checksums
0616e9f5829af220d13fa1928d489eb6790ab6ec646f59d33316e933ed17c024
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.1.13 CPython/3.9.7 Darwin/21.4.0

Release files / pilgrimor-0.1.2-py3-none-any.whl

Download URL pilgrimor-0.1.2-py3-none-any.whl
Size 17.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
963b4b6e1f069926d2a9699f08bc28f1508a1f9fa61952cc64b790ef0bab7e7d
BLAKE2b-256 checksum
How to use checksums
1bef9da1eab14c74df95af88ad2ec6f60751277aa5a910ef4cb797b5043fd63f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.1.13 CPython/3.9.7 Darwin/21.4.0

Release history Release notifications | RSS feed

This release

0.1.2 This release

2 release files

0.1.1

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page