Is there a simple way to transform Ecto migrations to sql script?

Scenario: I have an elixir app and postgresql database in a protected Azure environment. Protected meaning you can’t talk to the network its on from your dev box or any public box. Is there an adaptor or lib that will take ecto migrations and turn them into one .sql file that can then be moved over to the postgres vm and executed?

1 Like

No, as you can’t know which migrations to run, without asking the database which migrations have already been run.

Also migrations can contain arbitrary logic, that can’t get compiled into SQL.

But, no connection between your device machine and the application has to be made, just check during app boot if migrations are necessary.

IIRC in the destillery documentary was an example that did something similar.