Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion lib/ecto/migration/runner.ex
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,9 @@ defmodule Ecto.Migration.Runner do
{:ok, runner} = DynamicSupervisor.start_child(Ecto.MigratorSupervisor, {__MODULE__, args})
metadata(runner, opts)

log(level, "== Running #{version} #{inspect(module)}.#{operation}/0 #{direction}")
direction_msg = if operation == :change, do: " #{direction}", else: nil

log(level, "== Running #{version} #{inspect(module)}.#{operation}/0#{direction_msg}")
{time, _} = :timer.tc(fn -> perform_operation(repo, module, operation) end)
log(level, "== Migrated #{version} in #{inspect(div(time, 100_000) / 10)}s")
after
Expand Down
4 changes: 2 additions & 2 deletions test/ecto/migrator_test.exs
Original file line number Diff line number Diff line change
Expand Up @@ -327,7 +327,7 @@ defmodule Ecto.MigratorTest do
:ok = up(TestRepo, 12, UpDownMigration)
end)

assert output =~ "== Running 12 Ecto.MigratorTest.UpDownMigration.up/0 forward"
assert output =~ "== Running 12 Ecto.MigratorTest.UpDownMigration.up/0"
assert output =~ "alter table posts"
assert output =~ ~r"== Migrated 12 in \d.\ds"

Expand All @@ -336,7 +336,7 @@ defmodule Ecto.MigratorTest do
:ok = down(TestRepo, 12, UpDownMigration)
end)

assert output =~ "== Running 12 Ecto.MigratorTest.UpDownMigration.down/0 forward"
assert output =~ "== Running 12 Ecto.MigratorTest.UpDownMigration.down/0"
assert output =~ "execute \"foo\""
assert output =~ ~r"== Migrated 12 in \d.\ds"
end
Expand Down
Loading