A line of description
django-check-migration-wtf is an extension for Django to check migrations and notify you if their are secure to do on environments with zero downtime.
In some situations Django Migration system generate migrations to need do a downtime because they are blocking operation or you write custom migration than can block you database.
Actually this extension only works for backends of PostgresSQL and Postgis.
Advise: this extension notify you for common blocking operations on database. Anyway you should review your migrations and understand their.
It is really simple
Install the package with the typical tool (pip):
pip install django-check-migration-wtf
Add to your project
Add app on your settings:
INSTALLED_APPS = [ 'django_check_migration_wtf', ..., ]
Add some optional vars
Add some optional setup on your settings:
CHECK_MIGRATION_WTF_PSQL_VERSIONIt is to know your PostgresSQL Version by default it is 9
- The next following vars are for use github integration:
CHECK_MIGRATION_WTF_GITHUB_TOKENToken to can use API of github, It only need permission of reading of repo.
CHECK_MIGRATION_WTF_REPO_NAMEName of repository on Github
It is really easy to use. It is execute by a typical django command like
It has two mode of usage.
First execute your
makemigrations and you can do your custome modifications. Then before execute command
execute the following command:
python manage.py check_migration
It will search all migrations that are not apply to the system (like
showmigrations) and it will analyze if they are secure to do.
You can have two possibilities:
When the migration or migrations are secure, you get the following response:
When the migration or migrations are not secure, you get the following response:
This is reality an option of command to execute it on your continues integration. It will search you migrations comparing the base branch and your current branch and the analyze it
python manage.py check_migration --github <head_ref> <base_ref>
- This extension not analyze code inside of
- Github option to work correctly suppose your migrations are inside of directory migrations
Release history Release notifications | RSS feed
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
|Filename, size||File type||Python version||Upload date||Hashes|
|Filename, size django_check_migration_wtf-1.3.0-py3-none-any.whl (31.5 kB)||File type Wheel||Python version py3||Upload date||Hashes View|
|Filename, size django-check-migration-wtf-1.3.0.tar.gz (25.3 kB)||File type Source||Python version None||Upload date||Hashes View|
Hashes for django_check_migration_wtf-1.3.0-py3-none-any.whl
Hashes for django-check-migration-wtf-1.3.0.tar.gz