2019-04-25 19:05:05 +02:00
|
|
|
defmodule Mobilizon.Repo.Migrations.AddVisibilityToActor do
|
|
|
|
use Ecto.Migration
|
|
|
|
|
2019-09-09 00:52:49 +02:00
|
|
|
alias Mobilizon.Actors.ActorVisibility
|
2019-04-25 19:05:05 +02:00
|
|
|
|
|
|
|
def up do
|
2019-09-09 00:52:49 +02:00
|
|
|
ActorVisibility.create_type()
|
2019-04-25 19:05:05 +02:00
|
|
|
|
|
|
|
alter table(:actors) do
|
2019-09-09 00:52:49 +02:00
|
|
|
add(:visibility, ActorVisibility.type(), default: "private")
|
2019-04-25 19:05:05 +02:00
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
def down do
|
|
|
|
alter table(:actors) do
|
|
|
|
remove(:visibility)
|
|
|
|
end
|
|
|
|
|
2019-09-09 00:52:49 +02:00
|
|
|
ActorVisibility.drop_type()
|
2019-04-25 19:05:05 +02:00
|
|
|
end
|
|
|
|
end
|