]> 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 c01114d9eb6e19a549fb19e22057dbfcc559c641..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,
     }
 }
 
@@ -93,6 +97,8 @@ table! {
         followers_url -> Varchar,
         inbox_url -> Varchar,
         shared_inbox_url -> Nullable<Varchar>,
+        hidden -> Bool,
+        posting_restricted_to_mods -> Bool,
     }
 }
 
@@ -338,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,
@@ -355,7 +371,7 @@ table! {
         stickied -> Bool,
         embed_title -> Nullable<Text>,
         embed_description -> Nullable<Text>,
-        embed_html -> Nullable<Text>,
+        embed_video_url -> Nullable<Text>,
         thumbnail_url -> Nullable<Text>,
         ap_id -> Varchar,
         local -> Bool,
@@ -441,7 +457,6 @@ table! {
         id -> Int4,
         name -> Varchar,
         sidebar -> Nullable<Text>,
-        creator_id -> Int4,
         published -> Timestamp,
         updated -> Nullable<Timestamp>,
         enable_downvotes -> Bool,
@@ -455,6 +470,15 @@ table! {
         require_application -> Bool,
         application_question -> Nullable<Text>,
         private_instance -> Bool,
+        actor_id -> Text,
+        last_refreshed_at -> Timestamp,
+        inbox_url -> Text,
+        private_key -> Nullable<Text>,
+        public_key -> Text,
+        default_theme -> Text,
+        default_post_listing_type -> Text,
+        legal_information -> Nullable<Text>,
+        hide_modlog_mod_names -> Bool,
     }
 }
 
@@ -492,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,
@@ -568,6 +575,16 @@ table! {
   }
 }
 
+table! {
+  admin_purge_comment (id) {
+    id -> Int4,
+    admin_person_id -> Int4,
+    post_id -> Int4,
+    reason -> Nullable<Text>,
+    when_ -> Timestamp,
+  }
+}
+
 table! {
   email_verification (id) {
     id -> Int4,
@@ -578,6 +595,34 @@ table! {
   }
 }
 
+table! {
+  admin_purge_community (id) {
+    id -> Int4,
+    admin_person_id -> Int4,
+    reason -> Nullable<Text>,
+    when_ -> Timestamp,
+  }
+}
+
+table! {
+  admin_purge_person (id) {
+    id -> Int4,
+    admin_person_id -> Int4,
+    reason -> Nullable<Text>,
+    when_ -> Timestamp,
+  }
+}
+
+table! {
+  admin_purge_post (id) {
+    id -> Int4,
+    admin_person_id -> Int4,
+    community_id -> Int4,
+    reason -> Nullable<Text>,
+    when_ -> Timestamp,
+  }
+}
+
 table! {
     registration_application (id) {
         id -> Int4,
@@ -589,9 +634,19 @@ table! {
     }
 }
 
-joinable!(comment_alias_1 -> person_alias_1 (creator_id));
-joinable!(comment -> comment_alias_1 (parent_id));
+table! {
+    mod_hide_community (id) {
+        id -> Int4,
+        community_id -> Int4,
+        mod_person_id -> Int4,
+        reason -> Nullable<Text>,
+        hidden -> Nullable<Bool>,
+        when_ -> Timestamp,
+    }
+}
+
 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));
 
@@ -638,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));
@@ -648,11 +705,19 @@ joinable!(post_read -> post (post_id));
 joinable!(post_report -> post (post_id));
 joinable!(post_saved -> person (person_id));
 joinable!(post_saved -> post (post_id));
-joinable!(site -> person (creator_id));
 joinable!(site_aggregates -> site (site_id));
 joinable!(email_verification -> local_user (local_user_id));
 joinable!(registration_application -> local_user (local_user_id));
 joinable!(registration_application -> person (admin_id));
+joinable!(mod_hide_community -> person (mod_person_id));
+joinable!(mod_hide_community -> community (community_id));
+
+joinable!(admin_purge_comment -> person (admin_person_id));
+joinable!(admin_purge_comment -> post (post_id));
+joinable!(admin_purge_community -> person (admin_person_id));
+joinable!(admin_purge_person -> person (admin_person_id));
+joinable!(admin_purge_post -> community (community_id));
+joinable!(admin_purge_post -> person (admin_person_id));
 
 allow_tables_to_appear_in_same_query!(
   activity,
@@ -678,12 +743,14 @@ allow_tables_to_appear_in_same_query!(
   mod_remove_community,
   mod_remove_post,
   mod_sticky_post,
+  mod_hide_community,
   password_reset_request,
   person,
   person_aggregates,
   person_ban,
   person_block,
   person_mention,
+  comment_reply,
   post,
   post_aggregates,
   post_like,
@@ -693,9 +760,12 @@ allow_tables_to_appear_in_same_query!(
   private_message,
   site,
   site_aggregates,
-  comment_alias_1,
   person_alias_1,
   person_alias_2,
+  admin_purge_comment,
+  admin_purge_community,
+  admin_purge_person,
+  admin_purge_post,
   email_verification,
   registration_application
 );