I’m deploying with Releases for the first time and I’ve run into the issue where I need to create my database and populate it with some seed files before launching the web servers. The guide here: https://hexdocs.pm/phoenix/releases.html indicates that this can be done using the low level Ecto.Migrator
api described here https://hexdocs.pm/ecto_sql/Ecto.Migrator.html#run/.
My current project uses a structure.sql
file and discards old migration files as they became numerous during the project. In my dev environment I had a mix task like this:
"ecto.setup": [
"ecto.create",
"ecto.load",
"ecto.migrate",
"run priv/repo/seeds.exs",
"run priv/repo/more_seeds.exs"
],
that created the database structure and populated it with key seed files. I’m struggling to see how that would be possible using the API linked in the guides though as they discuss exclusively traversing a bunch of migration files.
Any advice would be appreciated!