Usher.Migration (Usher v0.1.2)

View Source

Migration helpers for creating Usher tables.

Use this module in your application's migrations to create the necessary database tables for Usher.

Summary

Functions

Creates the usher_invitations table.

Drops the usher_invitations table.

Functions

create_usher_invitations_table(opts \\ [])

Creates the usher_invitations table.

Usage

In your migration file:

defmodule MyApp.Repo.Migrations.CreateUsherInvitations do
  use Ecto.Migration
  import Usher.Migration

  def change do
    create_usher_invitations_table()
  end
end

Options

  • :table_name - Custom table name (defaults to configured table name)
  • :prefix - Schema prefix for the table

Examples

# Default table name
create_usher_invitations_table()

# Custom table name
create_usher_invitations_table(table_name: "my_invitations")

# With schema prefix
create_usher_invitations_table(prefix: "usher")

drop_usher_invitations_table(opts \\ [])

Drops the usher_invitations table.

Usage

drop_usher_invitations_table()

Options

  • :table_name - Custom table name (defaults to configured table name)

Examples

# Default table name
drop_usher_invitations_table()

# Custom table name
drop_usher_invitations_table(table_name: "my_invitations")