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.6.tar.gz (10.0 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.6-py3-none-any.whl (11.0 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: migra_maintained-1.0.6.tar.gz
  • Upload date:
  • Size: 10.0 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.6.tar.gz
Algorithm Hash digest
SHA256 9c9d19061eb832e6ad972d7647cb038d8154dc7f05c9d33837ab7608c42193b0
MD5 64c100f0f527eebb4d50e2823d0715a4
BLAKE2b-256 be83970d64098d505caea2df70973c8a1e827f2eeaeb55836d97bb5f4d435480

See more details on using hashes here.

Provenance

The following attestation bundles were made for migra_maintained-1.0.6.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.6-py3-none-any.whl.

File metadata

File hashes

Hashes for migra_maintained-1.0.6-py3-none-any.whl
Algorithm Hash digest
SHA256 9757870820e0dfd7781065c516e80626a49d646b653b697fe084b9e2c9b35cdf
MD5 11bfd883534fd8bf8f8031144b7e09d3
BLAKE2b-256 559e47537661ca1d1943f875ed0f045794c2dc4703809c4c760c2d27a5d1169f

See more details on using hashes here.

Provenance

The following attestation bundles were made for migra_maintained-1.0.6-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