defmodule Xee.Repo.Migrations.CreateUser do
  use Ecto.Migration

  def change do
    create table(:user) do
      add :name, :string
      add :crypted_password, :string

      timestamps
    end

  end
end

defmodule Xee.Repo.Migrations.CreateUser do
  use Ecto.Migration

  def change do
    create table(:user) do
      add :name, :string, null: false;
      add :crypted_password, :string, null: false;

      timestamps
    end

    # add unique constraints to user.name
    create unique_index(:user, [:name])
  end
end

Modify migration file to add unique constraint to all fields.
Modify migration file to add unique constraint to all fields.

xeejp/xee,xeejp/xee,xeejp/xee,xeejp/xee,xeejp/xee