docker icon indicating copy to clipboard operation
docker copied to clipboard

Suggestion : automatically run migrations at image startup

Open toadjaune opened this issue 5 years ago • 3 comments

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.sh script (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 !

toadjaune avatar Mar 30 '21 21:03 toadjaune

how can i tell whether an upgrade needs a database migration or not? if the db backend is sqlite, is db migration needed?

andrewchenshx avatar Mar 13 '22 13:03 andrewchenshx

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.

daniele-athome avatar Oct 31 '22 09:10 daniele-athome

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.

pparidans avatar Sep 05 '23 12:09 pparidans