Browse Source

Adding back in on_conflict.

unique_ap_ids
Dessalines 6 months ago
parent
commit
0578c8f548
2 changed files with 6 additions and 2 deletions
  1. +3
    -1
      server/lemmy_db/src/comment.rs
  2. +3
    -1
      server/lemmy_db/src/post.rs

+ 3
- 1
server/lemmy_db/src/comment.rs View File

@ -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::<Self>(conn)
}
}


+ 3
- 1
server/lemmy_db/src/post.rs View File

@ -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::<Self>(conn)
}
}


Loading…
Cancel
Save