diff --git a/lib/mobilizon/discussions/comment.ex b/lib/mobilizon/discussions/comment.ex index bfa0cf6a1..8ec1bd75a 100644 --- a/lib/mobilizon/discussions/comment.ex +++ b/lib/mobilizon/discussions/comment.ex @@ -126,6 +126,7 @@ defmodule Mobilizon.Discussions.Comment do |> put_assoc(:media, Map.get(attrs, :media, [])) |> put_tags(attrs) |> put_mentions(attrs) + |> unique_constraint(:url, name: :comments_url_index) end @spec maybe_generate_uuid(Ecto.Changeset.t()) :: Ecto.Changeset.t()