Skip to content

Commit d37bd8f

Browse files
Change schema_migration: true option to ecto_query: :schema_migrations (#633)
1 parent 41ed13e commit d37bd8f

2 files changed

Lines changed: 5 additions & 3 deletions

File tree

lib/ecto/migration/schema_migration.ex

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,9 @@ defmodule Ecto.Migration.SchemaMigration do
1717
@default_opts [
1818
timeout: :infinity,
1919
log: false,
20+
# Keep schema_migration for backwards compatibility
2021
schema_migration: true,
22+
ecto_query: :schema_migration,
2123
telemetry_options: [schema_migration: true]
2224
]
2325

test/support/test_repo.exs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -55,21 +55,21 @@ defmodule EctoSQL.TestAdapter do
5555

5656
def execute(_, _, {:nocache, {:all, query}}, _, opts) do
5757
%{from: %{source: {"schema_migrations", _}}} = query
58-
true = opts[:schema_migration]
58+
:schema_migrations = opts[:ecto_query]
5959
versions = MigrationsAgent.get()
6060
{length(versions), Enum.map(versions, &[elem(&1, 0)])}
6161
end
6262

6363
def execute(_, _, {:nocache, {:delete_all, query}}, params, opts) do
6464
%{from: %{source: {"schema_migrations", _}}} = query
6565
[version] = params
66-
true = opts[:schema_migration]
66+
:schema_migrations = opts[:ecto_query]
6767
MigrationsAgent.down(version, opts)
6868
{1, nil}
6969
end
7070

7171
def insert(_, %{source: "schema_migrations"}, val, _, _, opts) do
72-
true = opts[:schema_migration]
72+
:schema_migrations = opts[:ecto_query]
7373
version = Keyword.fetch!(val, :version)
7474
MigrationsAgent.up(version, opts)
7575
{:ok, []}

0 commit comments

Comments
 (0)