How to seed database in gigalixir?

I’m trying to redeploy an old app onto gigalixir but I’m having problems seeding the database.

In the past, the following would work:

gigalixir run -- mix run priv/repo/seeds.exs

But now when I run it, I get an error:

Attempting to run ‘priv/repo/seeds.exs’ in a new container.
[Errno 2] No such file or directory: ‘priv/repo/seeds.exs’

I also tried mix ecto.setup

Attempting to run ‘mix ecto.setup’ in a new container.
[Errno 2] No such file or directory: ‘mix’

I used to migrate using

gigalixir run mix ecto.migrate

But now that doesn’t seem to work and I have to use

gigalixir ps:migrate

How do I seed database nowadays?

It sounds like you are running as an Elixir Release, not in mix mode. This is why mix is not found.

If you use gigalixir ps:migrate it will utilize your release application to run the migration. It will connect to your application’s console and run the migration inside the application.

If you have specific questions about your application, feel free to reach out to help@gigalixir.com.

1 Like