From 5e67e5aa143ccfbb629900425918bf0e2040dd36 Mon Sep 17 00:00:00 2001 From: "byte[]" Date: Wed, 2 Dec 2020 13:43:32 -0500 Subject: [PATCH] drop affected notifications instead of moving them to the target (unique constraint violation) --- lib/philomena/images.ex | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/philomena/images.ex b/lib/philomena/images.ex index 64dea399..7b8ef1d6 100644 --- a/lib/philomena/images.ex +++ b/lib/philomena/images.ex @@ -734,7 +734,7 @@ defmodule Philomena.Images do {count, nil} = Notification |> where(actor_type: "Image", actor_id: ^source.id) - |> Repo.update_all(set: [actor_id: target.id]) + |> Repo.delete_all() {:ok, count} end