Adding back in on_conflict.

This commit is contained in:
Dessalines 2020-08-31 08:26:23 -05:00
parent 81b204c1b8
commit 0578c8f548
2 changed files with 6 additions and 2 deletions

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)
}
}

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)
}
}