Fief.Authority.Postgres.Migrations (Fief v0.1.0)

Copy Markdown View Source

Table definitions for Fief.Authority.Postgres (implementation.md ยง3.1): five tables, every one keyed by namespace โ€” the instance name, stringified. One set of migrations covers all instances sharing the database; adding an instance is rows, never DDL.

Lives under the adapter it provisions โ€” it exists solely to set up Fief.Authority.Postgres's tables.

Run from your own Ecto migration:

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

  def up, do: Fief.Authority.Postgres.Migrations.up()
  def down, do: Fief.Authority.Postgres.Migrations.down()
end

The DDL is idempotent (IF NOT EXISTS), so re-running up/0 is safe.

Summary

Functions

Drop the five fief tables.

Create the five fief tables.

Functions

down()

Drop the five fief tables.

up()

Create the five fief tables.