As part of the ECS-ification of the Django service, we are moving towards an automated database migration handling approach. Under this new approach, migrations will be automatically applied when a new version of the Django application is deployed. The easiest way to accomplish this would be to add it as an additional step in the Dockerfile entrypoint.
We may want to explore also adding an environment variable which could be used as a flag to determine if the migrations should be run. This would default to true for production, but could be turned off in order to speed up local development (and prevent issuing a migration before it's fully baked during local testing).
Description
As part of the ECS-ification of the Django service, we are moving towards an automated database migration handling approach. Under this new approach, migrations will be automatically applied when a new version of the Django application is deployed. The easiest way to accomplish this would be to add it as an additional step in the Dockerfile entrypoint.
We may want to explore also adding an environment variable which could be used as a flag to determine if the migrations should be run. This would default to true for production, but could be turned off in order to speed up local development (and prevent issuing a migration before it's fully baked during local testing).
Alternatives
Additional context
See the motivation for this change and the rest of the discussion here: https://github.com/WordPress/openverse-api/issues/1030