Skip to content
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

Perform unattended init and migration on application startup #270

Open
yangm97 opened this issue Jun 2, 2023 · 0 comments
Open

Perform unattended init and migration on application startup #270

yangm97 opened this issue Jun 2, 2023 · 0 comments

Comments

@yangm97
Copy link

yangm97 commented Jun 2, 2023

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant