6 published -> Timestamp,
7 updated -> Nullable<Timestamp>,
9 sensitive -> Nullable<Bool>,
14 use diesel_ltree::sql_types::Ltree;
15 use diesel::sql_types::*;
23 published -> Timestamp,
24 updated -> Nullable<Timestamp>,
29 distinguished -> Bool,
35 comment_aggregates (id) {
41 published -> Timestamp,
53 published -> Timestamp,
62 original_comment_text -> Text,
65 resolver_id -> Nullable<Int4>,
66 published -> Timestamp,
67 updated -> Nullable<Timestamp>,
76 published -> Timestamp,
85 description -> Nullable<Text>,
87 published -> Timestamp,
88 updated -> Nullable<Timestamp>,
93 private_key -> Nullable<Text>,
95 last_refreshed_at -> Timestamp,
96 icon -> Nullable<Varchar>,
97 banner -> Nullable<Varchar>,
98 followers_url -> Varchar,
100 shared_inbox_url -> Nullable<Varchar>,
102 posting_restricted_to_mods -> Bool,
107 community_aggregates (id) {
109 community_id -> Int4,
113 published -> Timestamp,
114 users_active_day -> Int8,
115 users_active_week -> Int8,
116 users_active_month -> Int8,
117 users_active_half_year -> Int8,
122 community_follower (id) {
124 community_id -> Int4,
126 published -> Timestamp,
127 pending -> Nullable<Bool>,
132 community_moderator (id) {
134 community_id -> Int4,
136 published -> Timestamp,
141 community_person_ban (id) {
143 community_id -> Int4,
145 published -> Timestamp,
146 expires -> Nullable<Timestamp>,
154 password_encrypted -> Text,
155 email -> Nullable<Text>,
158 default_sort_type -> Int2,
159 default_listing_type -> Int2,
160 interface_language -> Varchar,
161 show_avatars -> Bool,
162 send_notifications_to_email -> Bool,
163 validator_time -> Timestamp,
164 show_bot_accounts -> Bool,
166 show_read_posts -> Bool,
167 show_new_post_notifs -> Bool,
168 email_verified -> Bool,
169 accepted_application -> Bool,
176 mod_person_id -> Int4,
177 other_person_id -> Int4,
178 removed -> Nullable<Bool>,
184 mod_add_community (id) {
186 mod_person_id -> Int4,
187 other_person_id -> Int4,
188 community_id -> Int4,
189 removed -> Nullable<Bool>,
195 mod_transfer_community (id) {
197 mod_person_id -> Int4,
198 other_person_id -> Int4,
199 community_id -> Int4,
200 removed -> Nullable<Bool>,
208 mod_person_id -> Int4,
209 other_person_id -> Int4,
210 reason -> Nullable<Text>,
211 banned -> Nullable<Bool>,
212 expires -> Nullable<Timestamp>,
218 mod_ban_from_community (id) {
220 mod_person_id -> Int4,
221 other_person_id -> Int4,
222 community_id -> Int4,
223 reason -> Nullable<Text>,
224 banned -> Nullable<Bool>,
225 expires -> Nullable<Timestamp>,
233 mod_person_id -> Int4,
235 locked -> Nullable<Bool>,
241 mod_remove_comment (id) {
243 mod_person_id -> Int4,
245 reason -> Nullable<Text>,
246 removed -> Nullable<Bool>,
252 mod_remove_community (id) {
254 mod_person_id -> Int4,
255 community_id -> Int4,
256 reason -> Nullable<Text>,
257 removed -> Nullable<Bool>,
258 expires -> Nullable<Timestamp>,
264 mod_remove_post (id) {
266 mod_person_id -> Int4,
268 reason -> Nullable<Text>,
269 removed -> Nullable<Bool>,
275 mod_sticky_post (id) {
277 mod_person_id -> Int4,
279 stickied -> Nullable<Bool>,
285 password_reset_request (id) {
287 token_encrypted -> Text,
288 published -> Timestamp,
289 local_user_id -> Int4,
297 display_name -> Nullable<Varchar>,
298 avatar -> Nullable<Varchar>,
300 published -> Timestamp,
301 updated -> Nullable<Timestamp>,
303 bio -> Nullable<Text>,
305 private_key -> Nullable<Text>,
307 last_refreshed_at -> Timestamp,
308 banner -> Nullable<Varchar>,
310 inbox_url -> Varchar,
311 shared_inbox_url -> Nullable<Varchar>,
312 matrix_user_id -> Nullable<Text>,
315 ban_expires -> Nullable<Timestamp>,
320 person_aggregates (id) {
325 comment_count -> Int8,
326 comment_score -> Int8,
334 published -> Timestamp,
339 person_mention (id) {
341 recipient_id -> Int4,
344 published -> Timestamp,
351 recipient_id -> Int4,
354 published -> Timestamp,
362 url -> Nullable<Varchar>,
363 body -> Nullable<Text>,
365 community_id -> Int4,
368 published -> Timestamp,
369 updated -> Nullable<Timestamp>,
373 embed_title -> Nullable<Text>,
374 embed_description -> Nullable<Text>,
375 embed_video_url -> Nullable<Text>,
376 thumbnail_url -> Nullable<Text>,
384 post_aggregates (id) {
392 published -> Timestamp,
393 newest_comment_time_necro -> Timestamp,
394 newest_comment_time -> Timestamp,
404 published -> Timestamp,
413 published -> Timestamp,
422 original_post_name -> Varchar,
423 original_post_url -> Nullable<Text>,
424 original_post_body -> Nullable<Text>,
427 resolver_id -> Nullable<Int4>,
428 published -> Timestamp,
429 updated -> Nullable<Timestamp>,
438 published -> Timestamp,
443 private_message (id) {
446 recipient_id -> Int4,
450 published -> Timestamp,
451 updated -> Nullable<Timestamp>,
461 sidebar -> Nullable<Text>,
462 published -> Timestamp,
463 updated -> Nullable<Timestamp>,
464 enable_downvotes -> Bool,
465 open_registration -> Bool,
467 icon -> Nullable<Varchar>,
468 banner -> Nullable<Varchar>,
469 description -> Nullable<Text>,
470 community_creation_admin_only -> Bool,
471 require_email_verification -> Bool,
472 require_application -> Bool,
473 application_question -> Nullable<Text>,
474 private_instance -> Bool,
476 last_refreshed_at -> Timestamp,
478 private_key -> Nullable<Text>,
480 default_theme -> Text,
481 default_post_listing_type -> Text,
482 legal_information -> Nullable<Text>,
483 hide_modlog_mod_names -> Bool,
488 site_aggregates (id) {
495 users_active_day -> Int8,
496 users_active_week -> Int8,
497 users_active_month -> Int8,
498 users_active_half_year -> Int8,
507 published -> Timestamp,
512 community_block (id) {
515 community_id -> Int4,
516 published -> Timestamp,
520 // These are necessary since diesel doesn't have self joins / aliases
522 person_alias_1 (id) {
525 display_name -> Nullable<Varchar>,
526 avatar -> Nullable<Varchar>,
528 published -> Timestamp,
529 updated -> Nullable<Timestamp>,
531 bio -> Nullable<Text>,
533 private_key -> Nullable<Text>,
535 last_refreshed_at -> Timestamp,
536 banner -> Nullable<Varchar>,
538 inbox_url -> Varchar,
539 shared_inbox_url -> Nullable<Varchar>,
540 matrix_user_id -> Nullable<Text>,
543 ban_expires -> Nullable<Timestamp>,
548 person_alias_2 (id) {
551 display_name -> Nullable<Varchar>,
552 avatar -> Nullable<Varchar>,
554 published -> Timestamp,
555 updated -> Nullable<Timestamp>,
557 bio -> Nullable<Text>,
559 private_key -> Nullable<Text>,
561 last_refreshed_at -> Timestamp,
562 banner -> Nullable<Varchar>,
564 inbox_url -> Varchar,
565 shared_inbox_url -> Nullable<Varchar>,
566 matrix_user_id -> Nullable<Text>,
569 ban_expires -> Nullable<Timestamp>,
576 jwt_secret -> Varchar,
581 admin_purge_comment (id) {
583 admin_person_id -> Int4,
585 reason -> Nullable<Text>,
591 email_verification (id) {
593 local_user_id -> Int4,
595 verification_token -> Varchar,
596 published -> Timestamp,
601 admin_purge_community (id) {
603 admin_person_id -> Int4,
604 reason -> Nullable<Text>,
610 admin_purge_person (id) {
612 admin_person_id -> Int4,
613 reason -> Nullable<Text>,
619 admin_purge_post (id) {
621 admin_person_id -> Int4,
622 community_id -> Int4,
623 reason -> Nullable<Text>,
629 registration_application (id) {
631 local_user_id -> Int4,
633 admin_id -> Nullable<Int4>,
634 deny_reason -> Nullable<Text>,
635 published -> Timestamp,
640 mod_hide_community (id) {
642 community_id -> Int4,
643 mod_person_id -> Int4,
644 reason -> Nullable<Text>,
645 hidden -> Nullable<Bool>,
659 local_user_language(id) {
661 local_user_id -> Int4,
666 joinable!(person_mention -> person_alias_1 (recipient_id));
667 joinable!(comment_reply -> person_alias_1 (recipient_id));
668 joinable!(post -> person_alias_1 (creator_id));
669 joinable!(comment -> person_alias_1 (creator_id));
671 joinable!(post_report -> person_alias_2 (resolver_id));
672 joinable!(comment_report -> person_alias_2 (resolver_id));
674 joinable!(person_block -> person (person_id));
675 joinable!(person_block -> person_alias_1 (target_id));
677 joinable!(comment -> person (creator_id));
678 joinable!(comment -> post (post_id));
679 joinable!(comment_aggregates -> comment (comment_id));
680 joinable!(comment_like -> comment (comment_id));
681 joinable!(comment_like -> person (person_id));
682 joinable!(comment_like -> post (post_id));
683 joinable!(comment_report -> comment (comment_id));
684 joinable!(comment_saved -> comment (comment_id));
685 joinable!(comment_saved -> person (person_id));
686 joinable!(community_aggregates -> community (community_id));
687 joinable!(community_block -> community (community_id));
688 joinable!(community_block -> person (person_id));
689 joinable!(community_follower -> community (community_id));
690 joinable!(community_follower -> person (person_id));
691 joinable!(community_moderator -> community (community_id));
692 joinable!(community_moderator -> person (person_id));
693 joinable!(community_person_ban -> community (community_id));
694 joinable!(community_person_ban -> person (person_id));
695 joinable!(local_user -> person (person_id));
696 joinable!(mod_add_community -> community (community_id));
697 joinable!(mod_transfer_community -> community (community_id));
698 joinable!(mod_ban_from_community -> community (community_id));
699 joinable!(mod_lock_post -> person (mod_person_id));
700 joinable!(mod_lock_post -> post (post_id));
701 joinable!(mod_remove_comment -> comment (comment_id));
702 joinable!(mod_remove_comment -> person (mod_person_id));
703 joinable!(mod_remove_community -> community (community_id));
704 joinable!(mod_remove_community -> person (mod_person_id));
705 joinable!(mod_remove_post -> person (mod_person_id));
706 joinable!(mod_remove_post -> post (post_id));
707 joinable!(mod_sticky_post -> person (mod_person_id));
708 joinable!(mod_sticky_post -> post (post_id));
709 joinable!(password_reset_request -> local_user (local_user_id));
710 joinable!(person_aggregates -> person (person_id));
711 joinable!(person_ban -> person (person_id));
712 joinable!(person_mention -> comment (comment_id));
713 joinable!(person_mention -> person (recipient_id));
714 joinable!(comment_reply -> comment (comment_id));
715 joinable!(comment_reply -> person (recipient_id));
716 joinable!(post -> community (community_id));
717 joinable!(post -> person (creator_id));
718 joinable!(post_aggregates -> post (post_id));
719 joinable!(post_like -> person (person_id));
720 joinable!(post_like -> post (post_id));
721 joinable!(post_read -> person (person_id));
722 joinable!(post_read -> post (post_id));
723 joinable!(post_report -> post (post_id));
724 joinable!(post_saved -> person (person_id));
725 joinable!(post_saved -> post (post_id));
726 joinable!(site_aggregates -> site (site_id));
727 joinable!(email_verification -> local_user (local_user_id));
728 joinable!(registration_application -> local_user (local_user_id));
729 joinable!(registration_application -> person (admin_id));
730 joinable!(mod_hide_community -> person (mod_person_id));
731 joinable!(mod_hide_community -> community (community_id));
732 joinable!(post -> language (language_id));
733 joinable!(comment -> language (language_id));
734 joinable!(local_user_language -> language (language_id));
735 joinable!(local_user_language -> local_user (local_user_id));
737 joinable!(admin_purge_comment -> person (admin_person_id));
738 joinable!(admin_purge_comment -> post (post_id));
739 joinable!(admin_purge_community -> person (admin_person_id));
740 joinable!(admin_purge_person -> person (admin_person_id));
741 joinable!(admin_purge_post -> community (community_id));
742 joinable!(admin_purge_post -> person (admin_person_id));
744 allow_tables_to_appear_in_same_query!(
753 community_aggregates,
756 community_person_ban,
760 mod_transfer_community,
762 mod_ban_from_community,
765 mod_remove_community,
769 password_reset_request,
788 admin_purge_community,
792 registration_application,