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
1 changed files with 1 additions and 0 deletions

View File

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