bones73k/priv/repo/migrations/20200913000905_add_role_to_users.exs

21 lines
354 B
Elixir

defmodule Bones73k.Repo.Migrations.AddRoleToUsers do
use Ecto.Migration
alias Bones73k.Accounts.User.RolesEnum
def up do
RolesEnum.create_type()
alter table(:users) do
add(:role, RolesEnum.type(), null: false)
end
end
def down do
alter table(:users) do
remove(:role)
end
RolesEnum.drop_type()
end
end