We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
schema_migration: true
ecto_query: :schema_migrations
1 parent 41ed13e commit d37bd8fCopy full SHA for d37bd8f
2 files changed
lib/ecto/migration/schema_migration.ex
@@ -17,7 +17,9 @@ defmodule Ecto.Migration.SchemaMigration do
17
@default_opts [
18
timeout: :infinity,
19
log: false,
20
+ # Keep schema_migration for backwards compatibility
21
schema_migration: true,
22
+ ecto_query: :schema_migration,
23
telemetry_options: [schema_migration: true]
24
]
25
test/support/test_repo.exs
@@ -55,21 +55,21 @@ defmodule EctoSQL.TestAdapter do
55
56
def execute(_, _, {:nocache, {:all, query}}, _, opts) do
57
%{from: %{source: {"schema_migrations", _}}} = query
58
- true = opts[:schema_migration]
+ :schema_migrations = opts[:ecto_query]
59
versions = MigrationsAgent.get()
60
{length(versions), Enum.map(versions, &[elem(&1, 0)])}
61
end
62
63
def execute(_, _, {:nocache, {:delete_all, query}}, params, opts) do
64
65
[version] = params
66
67
MigrationsAgent.down(version, opts)
68
{1, nil}
69
70
71
def insert(_, %{source: "schema_migrations"}, val, _, _, opts) do
72
73
version = Keyword.fetch!(val, :version)
74
MigrationsAgent.up(version, opts)
75
{:ok, []}
0 commit comments