Skip to content

Commit d5153e3

Browse files
Stop runner if migration fails (#576)
1 parent 30c2cba commit d5153e3

2 files changed

Lines changed: 2 additions & 1 deletion

File tree

integration_test/sql/migrator.exs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -112,6 +112,7 @@ defmodule Ecto.Integration.MigratorTest do
112112

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

117118
test "broken link migration" do

lib/ecto/migration/runner.ex

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ defmodule Ecto.Migration.Runner do
2424
log(level, "== Running #{version} #{inspect(module)}.#{operation}/0 #{direction}")
2525
{time, _} = :timer.tc(fn -> perform_operation(repo, module, operation) end)
2626
log(level, "== Migrated #{version} in #{inspect(div(time, 100_000) / 10)}s")
27-
27+
after
2828
stop()
2929
end
3030

0 commit comments

Comments
 (0)