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

Uploaded Python 3

File details

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

File metadata

  • Download URL: migra_maintained-1.0.5.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.5.tar.gz
Algorithm Hash digest
SHA256 be6a7e9e40031b3ce8a35604865a9ced4d431e135ba97253b0ded6174f17ef0d
MD5 559490e4589718510b97b4fa9e69a168
BLAKE2b-256 0b67edb55328c80387c528372cab8f01258040e7ad5c8e08394639e582717a96

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for migra_maintained-1.0.5-py3-none-any.whl
Algorithm Hash digest
SHA256 4b95ef623cfa43aea5eaeeef7f50483a75b403b4942fed4bbd12e6b1aa9a2621
MD5 832af6dbcfff98716e357402a6b1946f
BLAKE2b-256 94fe15571de8d93c2b2fe9428f8d87b0b545a6618263dc1a69f73e4ebe79d80c

See more details on using hashes here.

Provenance

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