Today I Learned

A Hashrocket project

Ready to join Hashrocket? Find Openings here and apply today.

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
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.