Skip to main content

django-check-migration-wtf

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, versions support 11, 12, 13 and 14.

Advise: this extension notify you for common blocking operations on database. Anyway you should review your migrations and understand their.

Configuration

It is really simple

Installation

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_VERSION It is to know your PostgresSQL Version by default it is 9
  • The next following vars are for use github integration:
    • CHECK_MIGRATION_WTF_GITHUB_TOKEN Token to can use API of github, It only need permission of reading of repo.
    • CHECK_MIGRATION_WTF_REPO_NAME Name of repository on Github

Usage

It is really easy to use. It is execute by a typical django command like makemigrations or migrate... It has two mode of usage.

Local

First execute your makemigrations and you can do your custome modifications. Then before execute command migrate 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:

    image info

  • When the migration or migrations are not secure, you get the following response:

    image info

Github

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>

Limitations

  • This extension not analyze code inside of RunPython
  • Github option to work correctly suppose your migrations are inside of directory migrations

Metadata

Release files for django-check-migration-wtf 1.4.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for django-check-migration-wtf 1.4.0
File Size Uploaded Provenance Actions
django-check-migration-wtf-1.4.0.tar.gz 25.4 kB Without provenance Details for django-check-migration-wtf-1.4.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for django-check-migration-wtf 1.4.0
File Interpreter ABI Platform Actions
django_check_migration_wtf-1.4.0-py3-none-any.whl Python 3 none any Details for django_check_migration_wtf-1.4.0-py3-none-any.whl

Total release size: 57.0 kB

Release files / django-check-migration-wtf-1.4.0.tar.gz

Download URL django-check-migration-wtf-1.4.0.tar.gz
Size 25.4 kB
Tags Source
SHA-256 checksum
How to use checksums
abba5fd0b523a049c2e70c40b53a26d8e661d5e0182103fa1d9983b4da4394bb
BLAKE2b-256 checksum
How to use checksums
d23475e2524631482d4b2e1ef0851e787636b9eb170d0e817e87ab3dfdb990ee
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.8.15

Release files / django_check_migration_wtf-1.4.0-py3-none-any.whl

Download URL django_check_migration_wtf-1.4.0-py3-none-any.whl
Size 31.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
4c7cfaf3807c8b7282f790438ff9eb2300596bb77ba815fe79fbc497a0fa75fa
BLAKE2b-256 checksum
How to use checksums
3e54c395dcb571c5483728fd486c4e7b2ff6f3882b726b181083c4bc4f939e67
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.8.15

Security for django-check-migration-wtf 1.4.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page