Add unique constraint on event URL

Signed-off-by: Thomas Citharel <tcit@tcit.fr>
This commit is contained in:
Thomas Citharel 2022-10-31 18:07:49 +01:00
parent 2e631d3633
commit 9a135bb67f
No known key found for this signature in database
GPG key ID: A061B9DDE0CA0773

View file

@ -166,6 +166,7 @@ defmodule Mobilizon.Events.Event do
|> put_picture(attrs) |> put_picture(attrs)
|> validate_lengths() |> validate_lengths()
|> validate_end_time() |> validate_end_time()
|> unique_constraint(:url)
end end
@spec validate_lengths(Changeset.t()) :: Changeset.t() @spec validate_lengths(Changeset.t()) :: Changeset.t()