Like diff but for PostgreSQL schemas
Go to file
Jason Giancono 67da85c5a5
Add exclude schema option (#152)
* add exclude schema option

* update README
2020-10-08 10:31:01 +11:00
.circleci revert to 12 for now 2020-10-01 13:17:35 +10:00
.github cleanup funding file 2020-05-08 20:06:48 +10:00
deploy tags 2020-08-28 13:59:50 +10:00
docs Add exclude schema option (#152) 2020-10-08 10:31:01 +11:00
migra Add exclude schema option (#152) 2020-10-08 10:31:01 +11:00
tests Add exclude schema option (#152) 2020-10-08 10:31:01 +11:00
.dockerignore Added Dockerfile and .dockerignore 2018-01-12 13:31:19 +11:00
.flake8 .flake8 2018-10-29 09:56:16 +11:00
.gitignore better sequences, better enums 2020-06-30 22:13:03 +10:00
build-docker.sh Improved Docker container. 2018-08-05 22:13:12 +08:00
CODE_OF_CONDUCT.md Create CODE_OF_CONDUCT.md 2019-04-07 13:39:35 +10:00
docker-entrypoint.sh Log docker command only if env is enabled. 2018-08-05 22:18:42 +08:00
Dockerfile Improved Docker container. 2018-08-05 22:13:12 +08:00
LICENSE initial commit 2016-07-25 16:38:42 +12:00
Makefile add test output 2019-03-03 14:49:39 +11:00
MANIFEST.in new docs 2017-08-20 13:25:05 +10:00
pyproject.toml Add exclude schema option (#152) 2020-10-08 10:31:01 +11:00
README.md minor readme edit 2020-09-03 07:57:04 +10:00

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.

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. Its the migration tooling that is bad, because its 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