Remove ap_url from mention (#362)

This commit is contained in:
fdb-hiroshima
2018-12-18 15:03:47 +01:00
committed by GitHub
parent 9e799f2cf2
commit ce08346487
6 changed files with 17 additions and 6 deletions
-5
View File
@@ -15,7 +15,6 @@ pub struct Mention {
pub mentioned_id: i32,
pub post_id: Option<i32>,
pub comment_id: Option<i32>,
pub ap_url: String, // TODO: remove, since mentions don't have an AP URL actually, this field was added by mistake
}
#[derive(Insertable)]
@@ -24,13 +23,11 @@ pub struct NewMention {
pub mentioned_id: i32,
pub post_id: Option<i32>,
pub comment_id: Option<i32>,
pub ap_url: String,
}
impl Mention {
insert!(mentions, NewMention);
get!(mentions);
find_by!(mentions, find_by_ap_url, ap_url as &str);
list_by!(mentions, list_for_user, mentioned_id as i32);
list_by!(mentions, list_for_post, post_id as i32);
list_by!(mentions, list_for_comment, comment_id as i32);
@@ -103,7 +100,6 @@ impl Mention {
mentioned_id: mentioned.id,
post_id: Some(post.id),
comment_id: None,
ap_url: ment.link_props.href_string().unwrap_or_default(),
},
);
if notify {
@@ -119,7 +115,6 @@ impl Mention {
mentioned_id: mentioned.id,
post_id: None,
comment_id: Some(comment.id),
ap_url: ment.link_props.href_string().unwrap_or_default(),
},
);
if notify {
-1
View File
@@ -115,7 +115,6 @@ table! {
mentioned_id -> Int4,
post_id -> Nullable<Int4>,
comment_id -> Nullable<Int4>,
ap_url -> Varchar,
}
}