I'm trying to figure out what kind of situation would require using flush.
As a counter example, this (trivial) situation does not require flush :
defmodule MyRepo.Migrations.TestFlush do
use Ecto.Migration
def change do
create table(:test)
alter table(:test) do
add :a, :integer
end
end
end
It works both "forwards" and "backwards" using ecto.migrate
and ecto.rollback
respectively. The second macro "alter table" is dependent on the first macro "create table" completing. flush() is not required to indicate any sort of synchronous dependency here.
I'm trying to define situations where flush() is required to be invoked in order for a particular migration to run successfully.
Here's the docs for flush : https://hexdocs.pm/ecto/Ecto.Migration.html#flush/0
Here's the source code for flush : https://github.com/elixir-ecto/ecto/blob/master/lib/ecto/migration/runner.ex#L96
Note the source code for flush reverses the "commands", but it doesn't define what constitutes a command.
thanks!