You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Mar 27, 2023. It is now read-only.
Do we want to run migrate every time the container is started?
I know that in our use-case we migrate every time we restart the container because the build changes. But in general it feels wrong to touch the database structure everytime the container is just started even if we don't have to.
A problematic scenario: Say after an unexpected shutdown the database gets corrupted and we now try to re-migrate on startup.
In theory it should, but I am certain that errors can occur which are not detected by the integrity check of postgres on startup.
Are there other scenarios where one doesn't want to migrate?
I think the user needs to think the other way round, when do you want to migrate? And make that an explicit action
@maltezacharias suggested that we can add pass a variable which would have to be explicitly set on startup in order to migrate,
probably something like this: docker-compose up -e MIGRATE_DB=true
This way we can even set it to default in the development environment, but leave it out in production.
We could also pass something to the entrypoint.sh directly without using environment variables as docker-compose up executes the entrypoint and additional arguments are passed to the entrypoint.sh
This way we can even set it to default in the development environment, but leave it out in production.
We would need to find a solution for this
Sign up for freeto subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Do we want to run migrate every time the container is started?
I know that in our use-case we migrate every time we restart the container because the build changes. But in general it feels wrong to touch the database structure everytime the container is just started even if we don't have to.
A problematic scenario: Say after an unexpected shutdown the database gets corrupted and we now try to re-migrate on startup.
Originally posted by @kevihiiin in #21
The text was updated successfully, but these errors were encountered: