mirror of
https://github.com/philomena-dev/philomena.git
synced 2024-11-27 13:47:58 +01:00
Add missing constraint conversions for interaction tables
This commit is contained in:
parent
410332003b
commit
f92b61c176
3 changed files with 3 additions and 0 deletions
|
@ -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
|
||||||
|
|
|
@ -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
|
||||||
|
|
|
@ -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
|
||||||
|
|
Loading…
Reference in a new issue