Mix.Task.run "ecto.create", ["quiet", "-r", "ExMachina.TestRepo"]
Mix.Task.run "ecto.migrate", ["-r", "ExMachina.TestRepo"]

ExMachina.TestRepo.start_link
ExUnit.start()

Ecto.Adapters.SQL.Sandbox.mode(ExMachina.TestRepo, :manual)

Mix.Task.run "ecto.drop", ["quiet", "-r", "ExMachina.TestRepo"]
Mix.Task.run "ecto.create", ["quiet", "-r", "ExMachina.TestRepo"]
Mix.Task.run "ecto.migrate", ["-r", "ExMachina.TestRepo"]

ExMachina.TestRepo.start_link
ExUnit.start()

Ecto.Adapters.SQL.Sandbox.mode(ExMachina.TestRepo, :manual)

Drop the database for each test run
Drop the database for each test run

Now that we are using a single file for migrations, we should drop the
database each test run to get the new schema.

thoughtbot/ex_machina