Skip to main content

Yet another way to manage migrations: DBA as a service

Project description

https://badge.fury.io/py/django-north.png https://travis-ci.org/novafloss/django-north.png?branch=master https://readthedocs.org/projects/django-north/badge/ https://img.shields.io/codecov/c/github/novafloss/django-north/master.svg

Yet another way to manage migrations: DBA as a service.

Let your favorite DBAs define the database schema, and provide blue/green migration files. Drop django native migrations, and use DBA’s migrations everywhere.

Requirements

  • Postgresql only (>= 9.4)

  • Django, obviously. v1.8, v1.9, v1.10

  • Running under Python 2.7 or 3.4+

Documentation

The full documentation is at https://django-north.readthedocs.org.

Quickstart

Install Django North:

pip install django-north

In your settings.py :

INSTALLED_APPS = [
    # ...
    "django_north",
]

NORTH_MANAGE_DB = True
NORTH_MIGRATIONS_ROOT = '/path/to/sql/migrations/'
NORTH_TARGET_VERSION = '1.42'

Running Tests

You will need a usable Postgresql database in order to test the project. For example:

source <YOURVIRTUALENV>/bin/activate
export DATABASE_URL=postgres://USER:PASSWORD@HOST:PORT/NAME
(myenv) $ pip install -r requirements_test.txt

Run tests for a specific version

(myenv) $ ./runtest

Run tests for all versions (if tox is installed globally, you don’t need a virtual environment)

$ tox

Using the project

Many operations are documented in the Makefile. For more information, use:

$ make help

Credits

Tools used in rendering this package:

History

0.1.5 (2017-05-24)

  • Fix showfixtures command for Django 1.10

0.1.4 (2017-05-10)

  • Do not fail if fixtures do not exist. Use the closest fixtures for DB init and flush command.

  • Add support of python3.

0.1.3 (2017-04-18)

  • Use a Block if the sql file contains a ‘ALTER TYPE’ instruction Add a setting to customize the files to run in a Block.

0.1.2 (2017-04-13)

  • Use a Block if the sql file contains a CONCURRENTLY instruction.

0.1.1 (2017-04-11)

  • Add the possibility to configure the current version detector.

0.1.0 (2017-03-28)

  • First release on PyPI.

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

django-north-0.1.5.tar.gz (14.5 kB view details)

Uploaded Source

File details

Details for the file django-north-0.1.5.tar.gz.

File metadata

File hashes

Hashes for django-north-0.1.5.tar.gz
Algorithm Hash digest
SHA256 4d84251e460d7042775b3af8f9001b71c91edbddf79f86dafe14e705cbea6400
MD5 8d3b298cefb125aa147ef10d63ab507d
BLAKE2b-256 c9cd1ca2465db6dc646b63316dceb0ec877364f1ffae334563063bc34d9bf786

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page