Skip to main content

Like `diff` but for PostgreSQL schemas

Project description

migra: Like diff but for Postgres schemas

  • compare schemas

  • autogenerate migration scripts

  • autosync your development database from your application models

  • make your schema changes testable, robust, and (mostly) automatic

migra is a schema diff tool for PostgreSQL, written in Python. Use it in your python scripts, or from the command line like this:

$ migra postgresql:///a postgresql:///b
alter table "public"."products" add column newcolumn text;

alter table "public"."products" add constraint "x" CHECK ((price > (0)::numeric));

migra magically figures out all the statements required to get from A to B.

Most features of PostgreSQL are supported.

Migra supports PostgreSQL >= 9 only. Known issues exist with earlier versions. More recent versions are more comprehensively tested. Development resources are limited, and feature support rather than backwards compatibility is prioritised.

DEVELOPMENT

A passwordless login for a superuser with username=your_os_username is required for the test cases to run

THE DOCS

Documentation is at databaseci.com/docs/migra.

Folks, schemas are good

Schema migrations are without doubt the most cumbersome and annoying part of working with SQL databases. So much so that some people think that schemas themselves are bad!

But schemas are actually good. Enforcing data consistency and structure is a good thing. It’s the migration tooling that is bad, because it’s harder to use than it should be. migra is an attempt to change that, and make migrations easy, safe, and reliable instead of something to dread.

Contributing

Contributing is easy. Jump into the issues, find a feature or fix you'd like to work on, and get involved. Or create a new issue and suggest something completely different. If you're unsure about any aspect of the process, just ask.

Credits

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

migra_maintained-1.0.2.tar.gz (9.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

migra_maintained-1.0.2-py3-none-any.whl (10.7 kB view details)

Uploaded Python 3

File details

Details for the file migra_maintained-1.0.2.tar.gz.

File metadata

  • Download URL: migra_maintained-1.0.2.tar.gz
  • Upload date:
  • Size: 9.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for migra_maintained-1.0.2.tar.gz
Algorithm Hash digest
SHA256 d84c433be780d335e422fc8eb9643eab0020cdb66ba36f5ba4531f6ee73221b1
MD5 a88a8a5d60d4da76135099861e239365
BLAKE2b-256 00311f0b861e81502d0f19ac43eb7afd5294deb2ef4d8cf588ede3629528ec97

See more details on using hashes here.

Provenance

The following attestation bundles were made for migra_maintained-1.0.2.tar.gz:

Publisher: release.yml on PhilipWee/migra

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file migra_maintained-1.0.2-py3-none-any.whl.

File metadata

File hashes

Hashes for migra_maintained-1.0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 7adec782cadbf25805dd6d3a34138d57a0fa91ca6e1a1a049b32960385dc8310
MD5 1e3cd7db8000cd38b5de0460436b1a8a
BLAKE2b-256 bcfcdc16150c92ca0ea7262e94ebf3fb26068fca4099ad24b9a4b95ec4b4be87

See more details on using hashes here.

Provenance

The following attestation bundles were made for migra_maintained-1.0.2-py3-none-any.whl:

Publisher: release.yml on PhilipWee/migra

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

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