From 81b204c1b84f02b29d673a9801e2c086500e3d9f Mon Sep 17 00:00:00 2001 From: Dessalines Date: Mon, 31 Aug 2020 07:41:15 -0500 Subject: [PATCH] Trying to add back in the on_conflict_do_nothing. --- server/lemmy_db/src/comment.rs | 7 +------ server/lemmy_db/src/post.rs | 4 +--- 2 files changed, 2 insertions(+), 9 deletions(-) diff --git a/server/lemmy_db/src/comment.rs b/server/lemmy_db/src/comment.rs index 0e8ff50ae..10d5ee92c 100644 --- a/server/lemmy_db/src/comment.rs +++ b/server/lemmy_db/src/comment.rs @@ -61,9 +61,6 @@ impl Crud for Comment { } fn create(conn: &PgConnection, comment_form: &CommentForm) -> Result { - if let Some(for_ap_id) = &comment_form.ap_id { - println!("creating {}", for_ap_id); - } use crate::schema::comment::dsl::*; insert_into(comment) .values(comment_form) @@ -169,9 +166,7 @@ impl Comment { use crate::schema::comment::dsl::*; insert_into(comment) .values(comment_form) - .on_conflict(ap_id) - .do_update() - .set(comment_form) + .on_conflict_do_nothing() .get_result::(conn) } } diff --git a/server/lemmy_db/src/post.rs b/server/lemmy_db/src/post.rs index 177659eb9..026435cb8 100644 --- a/server/lemmy_db/src/post.rs +++ b/server/lemmy_db/src/post.rs @@ -183,9 +183,7 @@ impl Post { use crate::schema::post::dsl::*; insert_into(post) .values(post_form) - .on_conflict(ap_id) - .do_update() - .set(post_form) + .on_conflict_do_nothing() .get_result::(conn) } }