Skip to content

Commit 84dd74c

Browse files
authored
Only log 'forward' and 'backward' for 'change/0' (#690)
1 parent bddc7bc commit 84dd74c

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

lib/ecto/migration/runner.ex

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,9 @@ defmodule Ecto.Migration.Runner do
2121
{:ok, runner} = DynamicSupervisor.start_child(Ecto.MigratorSupervisor, {__MODULE__, args})
2222
metadata(runner, opts)
2323

24-
log(level, "== Running #{version} #{inspect(module)}.#{operation}/0 #{direction}")
24+
direction_msg = if operation == :change, do: " #{direction}", else: nil
25+
26+
log(level, "== Running #{version} #{inspect(module)}.#{operation}/0#{direction_msg}")
2527
{time, _} = :timer.tc(fn -> perform_operation(repo, module, operation) end)
2628
log(level, "== Migrated #{version} in #{inspect(div(time, 100_000) / 10)}s")
2729
after

test/ecto/migrator_test.exs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -327,7 +327,7 @@ defmodule Ecto.MigratorTest do
327327
:ok = up(TestRepo, 12, UpDownMigration)
328328
end)
329329

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

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

339-
assert output =~ "== Running 12 Ecto.MigratorTest.UpDownMigration.down/0 forward"
339+
assert output =~ "== Running 12 Ecto.MigratorTest.UpDownMigration.down/0"
340340
assert output =~ "execute \"foo\""
341341
assert output =~ ~r"== Migrated 12 in \d.\ds"
342342
end

0 commit comments

Comments
 (0)