Minimising Downtime with Migrations
gryevns opened this issue · 1 comments
Great guide - thanks!
Currently under the "Init the Database" section, the guide says:
And repeat this process every time you make model changes.
If I add a new column to a model/table does this mean until I execute zappa manage dev migrate
there will be downtime? If so how can I minimise downtime - can I run migrations without deploying new application logic?
You have to run locally:
python manage.py makemigrations
zappa update dev
To get the migration files to the zappa instance in Lambda, then
run
zappa manage dev migrate
to actually migrate.
Due to the nature of Django, the migration scripts are backward compatible so if you update the database before you push the column changes in your model, there will be no downtime.