Skip to content

Commit

Permalink
adds unique constraint to comment changeset #45
Browse files Browse the repository at this point in the history
  • Loading branch information
RobStallion committed Mar 1, 2019
1 parent ff3f1d3 commit 65f898e
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions test/support/comment.ex
Original file line number Diff line number Diff line change
Expand Up @@ -13,5 +13,6 @@ defmodule Alog.TestApp.Comment do
def changeset(comment_struct, attrs \\ %{}) do
comment_struct
|> cast(attrs, [:cid, :entry_id, :comment, :deleted])
|> unique_constraint(:cid, name: :comments_pkey)
end
end

0 comments on commit 65f898e

Please sign in to comment.