Skip to content

Conversation

@lucyb
Copy link
Contributor

@lucyb lucyb commented Apr 22, 2025

Dokku recommends that database migrations are not done during deployment, but before an app is deployed. They recommend that the migrations are applied during the "release" phase. This should stop deployments failing due to health checks timing out during a long running migration.

Refs: #2393

TODO:

  • test change works with dokku
  • figure out how to test migrations in CI (EDIT: this is now being done during unit testing of the dev image and during the smoke test of the prod image)
  • ensure migrations are still run in local dev (EDIT: this change only affects the prod image, the dev image is unchanged)

lucyb added 3 commits July 1, 2025 16:52
Dokku recommends that database migrations are not done during deployment, but
before an app is deployed. They recommend that the migrations are applied
during the "release" phase. This should stop deployments failing due to health
checks timing out during a long running migration.

Refs: #2393

TODO:
- [] test change
- [] figure out how to test migrations in CI
- [x] ensure migrations are still run in local dev
The logic for this was moved into deploy/prod.sh in the previous commit. This
is now executed during the release phase of a deployment using Dokku.
@lucyb lucyb force-pushed the run-migrations-in-release-phase branch from 4aee33e to 6edd1b9 Compare July 1, 2025 15:53
@lucyb
Copy link
Contributor Author

lucyb commented Jul 2, 2025

I've tried to test this change using Steve's PR to run it in devcontainers (with some small tweaks). However, this isn't pulling in the Profile, so I don't know if that's configured correctly (which is the part that I really want to test).

@lucyb lucyb closed this Jul 17, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant