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

Uploaded Python 3

File details

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

File metadata

  • Download URL: migra_maintained-1.0.3.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.3.tar.gz
Algorithm Hash digest
SHA256 1bc3556b9541d544624e2620dc36d6a74b5df8443dbb047b50865f35a80417fe
MD5 f4d22629d3a403960bcd516b4bc4ac56
BLAKE2b-256 3128811c16808082670832ebfbd0fb3a1a906dd3c215a532f1ed4c9d332591ff

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for migra_maintained-1.0.3-py3-none-any.whl
Algorithm Hash digest
SHA256 5cbe948592c9c2581491648c0473bfc566ea71f39f068984eb5af16d0f882a84
MD5 e91e961d05cc5a848f2e7b997acdd474
BLAKE2b-256 3ee5fd9f72f6111735f9e555e39593e8eff67ebda93d304c4cfc60bbaa1360bc

See more details on using hashes here.

Provenance

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