16 lines
334 B
Elixir
16 lines
334 B
Elixir
defmodule SendIt.Repo.Migrations.CreateContacts do
|
|
use Ecto.Migration
|
|
|
|
def change do
|
|
create table(:contacts) do
|
|
add :name, :string
|
|
add :email, :string
|
|
add :subscribed, :boolean, default: true, null: false
|
|
|
|
timestamps(type: :utc_datetime)
|
|
end
|
|
|
|
create unique_index(:contacts, [:email])
|
|
end
|
|
end
|