1๐
โ
- Clone the production database to a staging environment.
- Apply the migration in staging.
-
Verify everything works in staging.
-
Then either:
a. Point the network configuration to staging, configure production at your leisure and reconfigure the network back (0 downtime).
b. Update the production environment on live with the required packages and copy the database from staging environment into production (minimal downtime).
๐คuser764357
4๐
I was able to solve this without the need to clone the databases. What I did was:
- Deploy a version with the migration but without the actual django-modeltranslation changes.
- Run the migration. This will add several fields to the translated model but the code will still point to the original field.
- run the management command
python manage.py update_translation_fields
. This will clone the original field values to the default language field. - Deploy a newer version of the code with the django-modeltranslation changes.
๐คPepperoniPizza
- [Django]-Django How to get a queryset from another queryset in a template
- [Django]-'User' object has no attribute 'is_valid' Django
- [Django]-What are the problems with loading CSS and JS from Django to IIS7?
Source:stackexchange.com