Skip to content

Instantly share code, notes, and snippets.

@shankardevy
Created July 8, 2017 03:12
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save shankardevy/ca87eab8d94eb1dea9612073d2694b96 to your computer and use it in GitHub Desktop.
Save shankardevy/ca87eab8d94eb1dea9612073d2694b96 to your computer and use it in GitHub Desktop.
Change email field type to citext
defmodule Mango.Repo.Migrations.CreateCustomers do
use Ecto.Migration
def change do
execute "CREATE EXTENSION IF NOT EXISTS citext"
create table(:customers) do
add :name, :string
add :email, :citext
add :phone, :string
add :residence_area, :string
add :password_hash, :string
timestamps()
end
create unique_index(:customers, [:email])
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment