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

22 lines
356 B
Elixir
Raw Normal View History

2020-09-12 20:14:06 -04:00
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