-
Notifications
You must be signed in to change notification settings - Fork 16
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Run migrations automatically when a Docker container starts #342
Comments
Hm, I would say let us make this configurable via a environment variable? It seems like a potential risk running db migrations automatically on container start, I think I would prefer you have to explicitly define it when you want database migrations executed automatically. We can document this as the default way to run the containers in the README |
What risks do you think there are? |
Hm, mainly that changes to the database could potentially cause harm (like migrations causing data lose). I think it mainly feels wrong to me, but I cannot really put it into words why, which sucks. I tried to search for best practices or discussions about this topic online, but could not find anything really useful yet. |
I have seen apps implement checks to see what new migrations need to be ran. |
+1 to this, it makes self hosting this much easier. Most apps do not require a manual migrations step be run and simply updating a docker image will handle it natively |
In a professional environment we do this. And basically all other self-hosted apps I've seen do this as well (Home Assistant and Paperless-ngx off the top of my head). |
Yes I agree now, I would like to see this added as well, espscially in the context of the docker refactoring. Let's hope someone will find the time for this (not sure when I will sadly) |
Just add some commands to the Docker script to check for new migrations and if there are any, execute them.
This will prevent issues where users forget to run migrations on new versions.
TODO:
The text was updated successfully, but these errors were encountered: