Today I Learned

hashrocket A Hashrocket project

Logging SQL queries in Ecto migrations

There are some options to Ecto migrate and rollback to turn on the logging of the SQL queries executed:

mix ecto.migrate --log-migrations-sql --log-migrator-sql
mix ecto.rollback --log-migrations-sql --log-migrator-sql

By the way, prior to 3.7.1 version those two log options were combined in:

mix ecto.migrate --log-sql
mix ecto.rollback --log-sql
See More #elixir TILs
Looking for help? At Hashrocket, we 💜 Elixir! From our many Elixir client projects, to sponsoring the Chicago Elixir Meetup, to the source code for this application, we are invested in this community. Contact us today to talk about your Elixir project.