A Django Migrations extension providing a framework for Zero Downtime Continuous Delivery.
Project description
# django-zerodowntime
[![CircleCI](https://circleci.com/gh/rentlytics/django-zerodowntime.svg?style=svg)](https://circleci.com/gh/rentlytics/django-zerodowntime)
Management commands to help Django users build & deploy their projects with low interruption for their users. This method is often called Zero Downtime Continous Delivery, or ZDCD.
Database schema migrations are the most common cause of application downtime during a deployment. Some operations like adding a NULLed column or an entirely new table do not affect the application as it continues to run. Other operations such as removing/renaming a column/table can cause the deployed code to fail in unexpected ways. Ultimately you will have to remove or rename existing schema, but most deployments do not require downtime so the code can be updated without interrupting users.
This project was developed for use at [Rentlytics](http://rentlytics.com), [here is a copy](./Rentlytics-ZDCD.pdf) of the presentation which brought this project to life.
## Commands
### check_migrations Checks all pending migrations against the DEFAULT Django database for zero downtime deployment compatibility. A migration is considered compatible when it contains only: CreateModel, AddField, or AlterModelOptions operations. An exception is when AddField is used to create a new column with a default value provided. Providing a default value requires filling all existing rows with the value, which can be an expensive operation.
### insert_git_hooks Adds or modifies the git commit-msg hook at .git/hooks/commit-msg to execute check_migrations before each commit is saved to git’s history. When check_migrations exits with a non-zero exit code, an error message will be output listing the incompatible migration operations. In the event that incompatible migrations are to be allowed, you can add [allow-unsafe-migrations] to your commit message, which skips this check.
## Usage Guide * [Heroku + CircleCI](./examples/heroku/)
History
0.1.0 (2016-06-02)
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
Built Distribution
File details
Details for the file django-zerodowntime-0.2.7.tar.gz
.
File metadata
- Download URL: django-zerodowntime-0.2.7.tar.gz
- Upload date:
- Size: 24.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 97d7ed56dc7e9ff7baa80a257a29335980ca4d5e2e3803a814b6059f5db1f0b8 |
|
MD5 | 02f1c6650e49b5e06755e4f88cc1248a |
|
BLAKE2b-256 | 4b9906ee1c68b7bec87f7dcc17af49c83fe015bf7210c61ccf506e73f790a9e3 |
File details
Details for the file django_zerodowntime-0.2.7-py2.py3-none-any.whl
.
File metadata
- Download URL: django_zerodowntime-0.2.7-py2.py3-none-any.whl
- Upload date:
- Size: 7.8 kB
- Tags: Python 2, Python 3
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 89fa212b87dd202a08032e460e2c33baf1e76f1dcf8fe9447bf543aab45b3805 |
|
MD5 | 1c9ef58387631eb7eed9f3b39d8ddf02 |
|
BLAKE2b-256 | 78aeb4e97cce9091e640e0be65680c1d631e5aa108d7402cdf7c2e734e08479f |