From 0578c8f54837e49fbee103d44242a5ce2b723633 Mon Sep 17 00:00:00 2001 From: Dessalines Date: Mon, 31 Aug 2020 08:26:23 -0500 Subject: [PATCH] Adding back in on_conflict. --- server/lemmy_db/src/comment.rs | 4 +++- server/lemmy_db/src/post.rs | 4 +++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/server/lemmy_db/src/comment.rs b/server/lemmy_db/src/comment.rs index 10d5ee92c..c462db1bb 100644 --- a/server/lemmy_db/src/comment.rs +++ b/server/lemmy_db/src/comment.rs @@ -166,7 +166,9 @@ impl Comment { use crate::schema::comment::dsl::*; insert_into(comment) .values(comment_form) - .on_conflict_do_nothing() + .on_conflict(ap_id) + .do_update() + .set(comment_form) .get_result::(conn) } } diff --git a/server/lemmy_db/src/post.rs b/server/lemmy_db/src/post.rs index 026435cb8..177659eb9 100644 --- a/server/lemmy_db/src/post.rs +++ b/server/lemmy_db/src/post.rs @@ -183,7 +183,9 @@ impl Post { use crate::schema::post::dsl::*; insert_into(post) .values(post_form) - .on_conflict_do_nothing() + .on_conflict(ap_id) + .do_update() + .set(post_form) .get_result::(conn) } }