WordPress / openverse-api

The Openverse API allows programmatic access to search for CC-licensed and public domain digital media.
https://api.openverse.engineering/v1
MIT License
76 stars 50 forks source link

Add Django database migration to Dockerfile entrypoint #1048

Closed AetherUnbound closed 1 year ago

AetherUnbound commented 1 year ago

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