ReactiveDag.Migration (reactive_dag v0.16.0)

Copy Markdown View Source

The library-owned DDL, callable from a host migration — the dirty-frontier table ReactiveDag.Frontier reads and writes (coalesced by (cell_id, key); claim is a DELETE … RETURNING):

defmodule MyApp.Repo.Migrations.AddReactiveDag do
  use Ecto.Migration

  def up, do: ReactiveDag.Migration.up()
  def down, do: ReactiveDag.Migration.down()
end

The table name resolves exactly as Frontier's reads do — an explicit :dirty_table option, else config :reactive_dag, dirty_table:, else "reactive_dag_dirty" — so a host that sets the config gets a migration matching the table the runtime queries, with no second place to keep in sync.

Options (both directions):

  • :dirty_table — override the resolved table name for this migration only (rare; the config is the normal home).

The coordination TUPLE table is deliberately not created here: its schema is host-extended (extension columns like strength ride the host's CoordinationWriter), so its migration belongs to the host.

Summary

Functions

Drop the dirty-frontier table.

Create the dirty-frontier table + its coalescing unique index.

Functions

down(opts \\ [])

Drop the dirty-frontier table.

up(opts \\ [])

Create the dirty-frontier table + its coalescing unique index.