defmodule Aprsme.Repo.Migrations.AddRoleToUsers do
  use Ecto.Migration

  def change do
    alter table(:users) do
      add :role, :string, null: false, default: "user"
    end

    create constraint(:users, :users_role_must_be_valid, check: "role IN ('user', 'admin')")
  end
end
