Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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 )

like image 733
Chris Gaudreau Avatar asked Feb 05 '26 21:02

Chris Gaudreau


2 Answers

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

 mix ecto.migrate --log-sql > file.sql
like image 121
mljrg Avatar answered Feb 08 '26 20:02

mljrg


Unfortunately, according to the latest doc, there's no option like that. Consider creating issue for that in Ecto.

like image 37
PatNowak Avatar answered Feb 08 '26 20:02

PatNowak



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!