Add missing constraint conversions for interaction tables

This commit is contained in:
Liam 2024-06-02 22:58:09 -04:00
parent 410332003b
commit f92b61c176
3 changed files with 3 additions and 0 deletions

View file

@ -18,5 +18,6 @@ defmodule Philomena.ImageFaves.ImageFave do
image_fave image_fave
|> cast(attrs, []) |> cast(attrs, [])
|> validate_required([]) |> validate_required([])
|> unique_constraint([:image_id, :user_id], name: :index_image_faves_on_image_id_and_user_id)
end end
end end

View file

@ -18,5 +18,6 @@ defmodule Philomena.ImageHides.ImageHide do
image_hide image_hide
|> cast(attrs, []) |> cast(attrs, [])
|> validate_required([]) |> validate_required([])
|> unique_constraint([:image_id, :user_id], name: :index_image_hides_on_image_id_and_user_id)
end end
end end

View file

@ -19,5 +19,6 @@ defmodule Philomena.ImageVotes.ImageVote do
image_vote image_vote
|> cast(attrs, []) |> cast(attrs, [])
|> validate_required([]) |> validate_required([])
|> unique_constraint([:image_id, :user_id], name: :index_image_votes_on_image_id_and_user_id)
end end
end end