mobilizon/priv/repo/migrations/20190929175229_add_rejected_to_participant_role.exs
Thomas Citharel 5b4f1c271a
Send email notifications when a participation is approved/rejected
Also handles participant status :rejected instead of deleting the
participation

Closes #164

Signed-off-by: Thomas Citharel <tcit@tcit.fr>
2019-09-30 18:45:29 +02:00

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