eventstore icon indicating copy to clipboard operation
eventstore copied to clipboard

Perform unattended init and migration on application startup

Open yangm97 opened this issue 1 year ago • 0 comments

I'm looking into using commanded on embedded/edge/IoT devices (i.e. nerves) so it is not possible to run the init/create mix tasks before starting the BEAM, even if compiled as a release task. So migrations need to run during application startup, as a process.

An implementation of such feature can be seen in Ecto.Migrator. It provides a process that can be attached to the supervision tree to ensure the database schema is up to date.

https://hexdocs.pm/ecto_sql/Ecto.Migrator.html#module-example-running-migrations-on-application-startup

yangm97 avatar Jun 02 '23 21:06 yangm97