Skip to content

Improve database migrations reliability #4994

@lucyb

Description

@lucyb

Why are we doing this?

Dokku recommends that database migrations are done during deployment but before an app is deployed. They recommend that the migrations are applied during the "release" phase.

We recently had an outage where migrations were not fully applied during a deployment and the app needed to be redeployed in order for the migrations to be applied fully.

We applied the following change in OpenCodelists to address this: opensafely-core/opencodelists#2393 opensafely-core/opencodelists#2736

How will we know when it's done?

Migrations can be successfully applied during the release phase rather than during app start up.

What are we doing?

Moving the application of Django migrations to the Procfile : release and removing them from the entrypoint script that's run on container startup.

Note: we'll need to test this change, either with the same this approach taken for OpenCodelists or the potentially simpler approach using Vagrant taken by Becky.


Defining delivery tasks guidance

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions