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.1.0.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.1.0-py3-none-any.whl (11.0 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: migra_maintained-1.1.0.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.1.0.tar.gz
Algorithm Hash digest
SHA256 2f9a3b10d663a9bd7518b958fe90679511dd762a5b4206c30b5f0b1d5dac2ade
MD5 f01c1a7570e0fdbce36712973291d050
BLAKE2b-256 76e2d2f4a69ff9d20f1a2ecfc979b16e973f05b9e5030d2db7861d34ec1338a8

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for migra_maintained-1.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 fca881f038160c0db16f40ed58727ab2733dc6011b43ed353e38971c1c65f510
MD5 4f7df43543ac1e5c132ee0c1db2d8612
BLAKE2b-256 1ee59eeb8fe515095e96b329102e2b6eec5b05cb9f6b6a789b76671e1e18cd19

See more details on using hashes here.

Provenance

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