Skip to content

Commit

Permalink
Stop runner if migration fails (#576)
Browse files Browse the repository at this point in the history
  • Loading branch information
greg-rychlewski authored Nov 21, 2023
1 parent 30c2cba commit d5153e3
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
1 change: 1 addition & 0 deletions integration_test/sql/migrator.exs
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,7 @@ defmodule Ecto.Integration.MigratorTest do

test "bad execute migration" do
assert catch_error(up(PoolRepo, 31, BadMigration, log: false))
assert DynamicSupervisor.which_children(Ecto.MigratorSupervisor) == []
end

test "broken link migration" do
Expand Down
2 changes: 1 addition & 1 deletion lib/ecto/migration/runner.ex
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ defmodule Ecto.Migration.Runner do
log(level, "== Running #{version} #{inspect(module)}.#{operation}/0 #{direction}")
{time, _} = :timer.tc(fn -> perform_operation(repo, module, operation) end)
log(level, "== Migrated #{version} in #{inspect(div(time, 100_000) / 10)}s")

after
stop()
end

Expand Down

0 comments on commit d5153e3

Please sign in to comment.