Creates and drops Countersign's tables from a host migration, in the
shape of Oban.Migration.
Generate the host migration with mix countersign.gen.migration, or write
it by hand:
defmodule MyApp.Repo.Migrations.CreateCountersignTables do
use Ecto.Migration
def up, do: Countersign.Migrations.up(version: 1)
def down, do: Countersign.Migrations.down(version: 1)
endA later package release that changes the tables adds a version; the host
then adds a migration calling up(version: 2) and down(version: 2).
Versions
signing_requestsandsigning_codes.signing_requests.resent_times,verified_timesandsign_method: the time of every resend and every code verification, and whether the signature was drawn or typed, for the signing certificate (Countersign.Certificate).
Options
:version- forup/1, the version to migrate up to (default: the current version, 2); fordown/1, the version to migrate down to and including (default: 1, which drops every table).:prefix- the Postgres schema to create the tables in (default"public"). A prefix other than"public"is created when missing and is never dropped.
Every statement is idempotent: running up/1 or down/1 twice, or again
after it stopped part-way, succeeds and leaves the same schema.
Summary
Functions
The newest migration version this release of Countersign ships.
Migrates down to and including :version (default 1). Call it inside a migration.
Migrates up to :version (default: the current version). Call it inside a migration.
Functions
@spec current_version() :: pos_integer()
The newest migration version this release of Countersign ships.
@spec down(keyword()) :: :ok
Migrates down to and including :version (default 1). Call it inside a migration.
@spec up(keyword()) :: :ok
Migrates up to :version (default: the current version). Call it inside a migration.