Creates and drops the outbox table.
Generate a migration in your application and delegate to this module:
defmodule MyApp.Repo.Migrations.AddOutboxer do
use Ecto.Migration
def up, do: Outboxer.Migration.up()
def down, do: Outboxer.Migration.down()
endThe same migration works on Postgres and SQLite.
Options
:table- table name, default"outboxer_messages". Pass the same value as:tabletoOutboxer.:prefix- Postgres schema to create the table in.:version- schema version to migrate to (up/1) or back to (down/1). Defaults to the latest forup/1and to0(nothing left) fordown/1. Later releases that change the table will add versions; you then write a new migration callingup(version: n).
What gets created
One table and three partial indexes. The indexes that the workers use cover
only rows with status = 'pending', so their size follows the backlog, not
the history.
Summary
Functions
Migrates the outbox table down to :version (default: 0, dropping it).
Migrates the outbox table up to :version (default: latest).