]> Untitled Git - lemmy.git/blobdiff - crates/db_schema/src/schema.rs
Adding distinguish comment. Fixes #2002 (#2391)
[lemmy.git] / crates / db_schema / src / schema.rs
index 91ad72789d9670c17388d6c6d4d2d29cb725e254..4c2caaf06c738071bae18d3e1b9fb2251052edb8 100644 (file)
@@ -11,19 +11,22 @@ table! {
 }
 
 table! {
+  use diesel_ltree::sql_types::Ltree;
+  use diesel::sql_types::*;
+
     comment (id) {
         id -> Int4,
         creator_id -> Int4,
         post_id -> Int4,
-        parent_id -> Nullable<Int4>,
         content -> Text,
         removed -> Bool,
-        read -> Bool,
         published -> Timestamp,
         updated -> Nullable<Timestamp>,
         deleted -> Bool,
         ap_id -> Varchar,
         local -> Bool,
+        path -> Ltree,
+        distinguished -> Bool,
     }
 }
 
@@ -35,6 +38,7 @@ table! {
         upvotes -> Int8,
         downvotes -> Int8,
         published -> Timestamp,
+        child_count ->  Int4,
     }
 }
 
@@ -340,6 +344,16 @@ table! {
     }
 }
 
+table! {
+    comment_reply (id) {
+        id -> Int4,
+        recipient_id -> Int4,
+        comment_id -> Int4,
+        read -> Bool,
+        published -> Timestamp,
+    }
+}
+
 table! {
     post (id) {
         id -> Int4,
@@ -464,6 +478,7 @@ table! {
         default_theme -> Text,
         default_post_listing_type -> Text,
         legal_information -> Nullable<Text>,
+        hide_modlog_mod_names -> Bool,
     }
 }
 
@@ -501,23 +516,6 @@ table! {
 }
 
 // These are necessary since diesel doesn't have self joins / aliases
-table! {
-    comment_alias_1 (id) {
-        id -> Int4,
-        creator_id -> Int4,
-        post_id -> Int4,
-        parent_id -> Nullable<Int4>,
-        content -> Text,
-        removed -> Bool,
-        read -> Bool,
-        published -> Timestamp,
-        updated -> Nullable<Timestamp>,
-        deleted -> Bool,
-        ap_id -> Varchar,
-        local -> Bool,
-    }
-}
-
 table! {
     person_alias_1 (id) {
         id -> Int4,
@@ -647,9 +645,8 @@ table! {
     }
 }
 
-joinable!(comment_alias_1 -> person_alias_1 (creator_id));
-joinable!(comment -> comment_alias_1 (parent_id));
 joinable!(person_mention -> person_alias_1 (recipient_id));
+joinable!(comment_reply -> person_alias_1 (recipient_id));
 joinable!(post -> person_alias_1 (creator_id));
 joinable!(comment -> person_alias_1 (creator_id));
 
@@ -696,6 +693,8 @@ joinable!(person_aggregates -> person (person_id));
 joinable!(person_ban -> person (person_id));
 joinable!(person_mention -> comment (comment_id));
 joinable!(person_mention -> person (recipient_id));
+joinable!(comment_reply -> comment (comment_id));
+joinable!(comment_reply -> person (recipient_id));
 joinable!(post -> community (community_id));
 joinable!(post -> person (creator_id));
 joinable!(post_aggregates -> post (post_id));
@@ -751,6 +750,7 @@ allow_tables_to_appear_in_same_query!(
   person_ban,
   person_block,
   person_mention,
+  comment_reply,
   post,
   post_aggregates,
   post_like,
@@ -760,7 +760,6 @@ allow_tables_to_appear_in_same_query!(
   private_message,
   site,
   site_aggregates,
-  comment_alias_1,
   person_alias_1,
   person_alias_2,
   admin_purge_comment,