Suggestion : automatically run migrations at image startup
Hi everybody !
I was surprised today to (re)discover that the database migration procedure requires a manual intervention.
I can think of several ways this could easily be done :
- Directly in the default case of the
entrypoint.shscript (instead of a separate case) - In the ansible playbook
The current setup seems to purposefully avoid doing so, so I'm wondering : is this a purposeful design choice ? If so, what are the motivations behind this design ?
Otherwise, I'd be glad to give a hand implementing it !
how can i tell whether an upgrade needs a database migration or not? if the db backend is sqlite, is db migration needed?
how can i tell whether an upgrade needs a database migration or not?
Isn't that point of running the migration utility? It will determine whether the database needs migrations to run or not. You just run it at startup every time.
Asking myself the same question as the OP : why not provide a way to automatically run migration at container startup.
Would probably be an "opt-in" feature, though.
As an example, the RUN_MIGRATIONS environment variable in Miniflux could be an interesting way to implement it.