forked from potsda.mn/mobilizon
5b4f1c271a
Also handles participant status :rejected instead of deleting the participation Closes #164 Signed-off-by: Thomas Citharel <tcit@tcit.fr>
22 lines
489 B
Elixir
22 lines
489 B
Elixir
defmodule Mobilizon.Storage.Repo.Migrations.AddRejectedToParticipantRole do
|
|
use Ecto.Migration
|
|
alias Mobilizon.Storage.Repo
|
|
alias Mobilizon.Events.Participant
|
|
alias Mobilizon.Events.ParticipantRole
|
|
import Ecto.Query
|
|
|
|
@disable_ddl_transaction true
|
|
|
|
def up do
|
|
Ecto.Migration.execute(
|
|
"ALTER TYPE #{ParticipantRole.type()} ADD VALUE IF NOT EXISTS 'rejected'"
|
|
)
|
|
end
|
|
|
|
def down do
|
|
Participant
|
|
|> where(role: "rejected")
|
|
|> Repo.delete_all()
|
|
end
|
|
end
|