Packages

A flexible authentication (and more) solution for Phoenix

Current section

Files

Jump to
haytni priv migrations 0-authenticable_changes.ex
Raw

priv/migrations/0-authenticable_changes.ex

defmodule Haytni.Migrations.AuthenticableCreation do
use Ecto.Migration
def change(table \\ <%= inspect table %>) do
create_if_not_exists table(table) do
# NOP
end
alter table(table) do
add :email, :string, null: false
add :encrypted_password, :string, null: false
end
create index(table, ~W[email]a, unique: true)
end
end