Search code examples
elixirphoenix-frameworkecto

Output generated DDL for ecto migrations


Is it possible to output the DDL generated by migrations in ecto? I would imagine a command similar to:

mix ecto.migrate --verbose

If we have a create_user migration, it would output something like:

CREATE TABLE users( id int unsigned auto_increment primary key, username varchar(255) not null )


Solution

  • It is now possible to output the migration SQL like this:

     mix ecto.migrate --log-sql > file.sql