Generate a green migration files for Django
Project description
django-green-migrations
Version {version} While the server is running, if you deploy a new version which contains a migration that drop a field, it will make your production down. This is because the migration will be executed before the new code is deployed. This package will help you to avoid this problem.
Normal deployment
- Deploy new code to server
- Keep server running
- Run migrations
- Switch to new code
- Destroy old code
At step 3, if the migration contains a field drop, the server will be down.
Green deployment
- Deploy new code to server
- Keep server running
- Run green migration
python manage.py green_migrate
- Run migrations
- Switch to new code
- Destroy old code
- Run pos green migration
python manage.py pos_green_migrate
At step 3, it will modify drop
migration to nullable and blankable
migration, this will help both old and new code to work.
At step 7, it will read the output from step 3 to drop fields, this will help to clean up the database.
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
Hashes for django-green-migration-1.0.0.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | c02a2dba15e1ab4f7c1937dc3866df61dd2f4b3b647dfc5d1e9245d2a7740cf1 |
|
MD5 | 7670b0c00cf59f48d15f9233ba2e4acc |
|
BLAKE2b-256 | c337fb5e51bab751c74d007279d56e77b68f9f538a6143c585a724c458bfce9b |
Hashes for django_green_migration-1.0.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1c22de8d2b2bc0c3168c55d907f89e1118413ae8cad48e397ef9e536629d70e4 |
|
MD5 | 2d7bdf1f405f7606d700018dd23030e3 |
|
BLAKE2b-256 | 17d10a372d292cb524b1259b42c84bb923ff3f29aeadf9d4204f9b22de9b87bc |