Skip to content

Instantly share code, notes, and snippets.

@bnhansn
Created October 20, 2016 19:29
Show Gist options
  • Save bnhansn/f393f57444b30dbfa442fe0d0070a2dc to your computer and use it in GitHub Desktop.
Save bnhansn/f393f57444b30dbfa442fe0d0070a2dc to your computer and use it in GitHub Desktop.
defmodule Sling.Repo.Migrations.CreateUser do
use Ecto.Migration
def change do
create table(:users) do
add :username, :string, null: false
add :email, :string, null: false
add :password_hash, :string, null: false
timestamps()
end
create unique_index(:users, [:username])
create unique_index(:users, [:email])
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment