Rollback Test Database

Is there a way to use mix ecto.rollback to rollback my test database? I created a model and migrated it. I rolled it back to adjust the precision for my decimal type after my test failed (I didn’t account for decimal positions). After I updated the migration and used mix to migrate, my test still fails because I don’t think the test database rolled back and migrated with the updated migration file.

2 Likes

mix test cleans up database i believe.
to be sure you can try MIX_ENV=test mix ecto.rollback or mix ecto.reset

4 Likes

Thanks! MIX_ENV=test mix ecto.reset worked for me.

2 Likes

the posted solutions worked for me, but this bit me for a few hours