From 65f898e66ba87084ef65f53dc63231d5979e9b19 Mon Sep 17 00:00:00 2001 From: Robert Francis Date: Fri, 1 Mar 2019 20:22:35 +0000 Subject: [PATCH] adds unique constraint to comment changeset #45 --- test/support/comment.ex | 1 + 1 file changed, 1 insertion(+) diff --git a/test/support/comment.ex b/test/support/comment.ex index bbb792c..ee1b788 100644 --- a/test/support/comment.ex +++ b/test/support/comment.ex @@ -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 \ No newline at end of file