bones73k/priv/repo/migrations/20200913000905_add_role_to_users.exs
João Gilberto Balsini Moura 33029dae04 Add roles to user
2020-09-12 21:14:06 -03:00

21 lines
356 B
Elixir

defmodule RealEstate.Repo.Migrations.AddRoleToUsers do
use Ecto.Migration
alias RealEstate.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