Skip to content

For emergencies, call +44 7537 179434 and press 0.

Database migrations

migretti

Available

One transaction per migration, and an advisory lock against concurrent runs.

A migration tool for Python projects on PostgreSQL. Each migration is a plain SQL file with an up and a down section and a ULID prefix in its name. Migrations run one at a time, each in its own transaction. An advisory lock stops two deployments migrating at the same time, and stored checksums show when a file on disk no longer matches what was applied. Against an environment named production it asks for confirmation before it changes anything.

Who it is for. Python teams on PostgreSQL who write and review their schema changes as SQL.

Status
Available
Part of
Open source
Licence
Open source, Apache 2.0
Tags
PythonPostgreSQLSQLCLIMigrations

What it does

  • One transaction per migration

    Each migration is committed before the next begins. Statements that cannot run in a transaction, such as CREATE INDEX CONCURRENTLY, are marked in the file.

  • Advisory lock

    A PostgreSQL advisory lock lets only one migration process run at a time.

  • Checks before changes

    mg verify compares applied migrations with their checksums. A dry run executes the SQL inside a transaction that is then rolled back.

Documentation and access details are on the product site, github.com/rodmena-limited/migretti. For a pilot, an integration or procurement questions, contact us.