Skip to main content

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


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)

Uploaded Source

Built Distribution

pilgrimor-0.1.2-py3-none-any.whl (17.6 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page