Creates the two tables Managoat.OAuth needs, from a migration of the
host's own (the shape Oban uses; a hex package cannot run mix ecto.migrate for its host). In MyApp.Repo.Migrations.AddOAuth, say:
use Ecto.Migration
def up, do: Managoat.OAuth.Migration.up()
def down, do: Managoat.OAuth.Migration.down()Options, the same for up/1 and down/1:
:subject_column— the name of the column that holds the host's subject,:user_idby default. It is abinary_idwith no foreign key; a host that wants one references its own table in the same migration (alter table(:oauth_authorization_codes) do modify ...).:prefix— the Postgres schema to create the tables in, the default schema when nil. Pass the same value asprefix:in the instance's config.up/1creates the schema first unlesscreate_schema: false.
Summary
Functions
Drop both tables. The schema, if :prefix named one, is left in place.
Create both tables and their indexes.