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,
34 comment_aggregates (id) {
40 published -> Timestamp,
52 published -> Timestamp,
61 original_comment_text -> Text,
64 resolver_id -> Nullable<Int4>,
65 published -> Timestamp,
66 updated -> Nullable<Timestamp>,
75 published -> Timestamp,
84 description -> Nullable<Text>,
86 published -> Timestamp,
87 updated -> Nullable<Timestamp>,
92 private_key -> Nullable<Text>,
94 last_refreshed_at -> Timestamp,
95 icon -> Nullable<Varchar>,
96 banner -> Nullable<Varchar>,
97 followers_url -> Varchar,
99 shared_inbox_url -> Nullable<Varchar>,
101 posting_restricted_to_mods -> Bool,
106 community_aggregates (id) {
108 community_id -> Int4,
112 published -> Timestamp,
113 users_active_day -> Int8,
114 users_active_week -> Int8,
115 users_active_month -> Int8,
116 users_active_half_year -> Int8,
121 community_follower (id) {
123 community_id -> Int4,
125 published -> Timestamp,
126 pending -> Nullable<Bool>,
131 community_moderator (id) {
133 community_id -> Int4,
135 published -> Timestamp,
140 community_person_ban (id) {
142 community_id -> Int4,
144 published -> Timestamp,
145 expires -> Nullable<Timestamp>,
153 password_encrypted -> Text,
154 email -> Nullable<Text>,
157 default_sort_type -> Int2,
158 default_listing_type -> Int2,
159 interface_language -> Varchar,
160 show_avatars -> Bool,
161 send_notifications_to_email -> Bool,
162 validator_time -> Timestamp,
163 show_bot_accounts -> Bool,
165 show_read_posts -> Bool,
166 show_new_post_notifs -> Bool,
167 email_verified -> Bool,
168 accepted_application -> Bool,
175 mod_person_id -> Int4,
176 other_person_id -> Int4,
177 removed -> Nullable<Bool>,
183 mod_add_community (id) {
185 mod_person_id -> Int4,
186 other_person_id -> Int4,
187 community_id -> Int4,
188 removed -> Nullable<Bool>,
194 mod_transfer_community (id) {
196 mod_person_id -> Int4,
197 other_person_id -> Int4,
198 community_id -> Int4,
199 removed -> Nullable<Bool>,
207 mod_person_id -> Int4,
208 other_person_id -> Int4,
209 reason -> Nullable<Text>,
210 banned -> Nullable<Bool>,
211 expires -> Nullable<Timestamp>,
217 mod_ban_from_community (id) {
219 mod_person_id -> Int4,
220 other_person_id -> Int4,
221 community_id -> Int4,
222 reason -> Nullable<Text>,
223 banned -> Nullable<Bool>,
224 expires -> Nullable<Timestamp>,
232 mod_person_id -> Int4,
234 locked -> Nullable<Bool>,
240 mod_remove_comment (id) {
242 mod_person_id -> Int4,
244 reason -> Nullable<Text>,
245 removed -> Nullable<Bool>,
251 mod_remove_community (id) {
253 mod_person_id -> Int4,
254 community_id -> Int4,
255 reason -> Nullable<Text>,
256 removed -> Nullable<Bool>,
257 expires -> Nullable<Timestamp>,
263 mod_remove_post (id) {
265 mod_person_id -> Int4,
267 reason -> Nullable<Text>,
268 removed -> Nullable<Bool>,
274 mod_sticky_post (id) {
276 mod_person_id -> Int4,
278 stickied -> Nullable<Bool>,
284 password_reset_request (id) {
286 token_encrypted -> Text,
287 published -> Timestamp,
288 local_user_id -> Int4,
296 display_name -> Nullable<Varchar>,
297 avatar -> Nullable<Varchar>,
299 published -> Timestamp,
300 updated -> Nullable<Timestamp>,
302 bio -> Nullable<Text>,
304 private_key -> Nullable<Text>,
306 last_refreshed_at -> Timestamp,
307 banner -> Nullable<Varchar>,
309 inbox_url -> Varchar,
310 shared_inbox_url -> Nullable<Varchar>,
311 matrix_user_id -> Nullable<Text>,
314 ban_expires -> Nullable<Timestamp>,
319 person_aggregates (id) {
324 comment_count -> Int8,
325 comment_score -> Int8,
333 published -> Timestamp,
338 person_mention (id) {
340 recipient_id -> Int4,
343 published -> Timestamp,
350 recipient_id -> Int4,
353 published -> Timestamp,
361 url -> Nullable<Varchar>,
362 body -> Nullable<Text>,
364 community_id -> Int4,
367 published -> Timestamp,
368 updated -> Nullable<Timestamp>,
372 embed_title -> Nullable<Text>,
373 embed_description -> Nullable<Text>,
374 embed_video_url -> Nullable<Text>,
375 thumbnail_url -> Nullable<Text>,
383 post_aggregates (id) {
391 published -> Timestamp,
392 newest_comment_time_necro -> Timestamp,
393 newest_comment_time -> Timestamp,
403 published -> Timestamp,
412 published -> Timestamp,
421 original_post_name -> Varchar,
422 original_post_url -> Nullable<Text>,
423 original_post_body -> Nullable<Text>,
426 resolver_id -> Nullable<Int4>,
427 published -> Timestamp,
428 updated -> Nullable<Timestamp>,
437 published -> Timestamp,
442 private_message (id) {
445 recipient_id -> Int4,
449 published -> Timestamp,
450 updated -> Nullable<Timestamp>,
460 sidebar -> Nullable<Text>,
461 published -> Timestamp,
462 updated -> Nullable<Timestamp>,
463 enable_downvotes -> Bool,
464 open_registration -> Bool,
466 icon -> Nullable<Varchar>,
467 banner -> Nullable<Varchar>,
468 description -> Nullable<Text>,
469 community_creation_admin_only -> Bool,
470 require_email_verification -> Bool,
471 require_application -> Bool,
472 application_question -> Nullable<Text>,
473 private_instance -> Bool,
475 last_refreshed_at -> Timestamp,
477 private_key -> Nullable<Text>,
479 default_theme -> Text,
480 default_post_listing_type -> Text,
481 legal_information -> Nullable<Text>,
482 hide_modlog_mod_names -> Bool,
487 site_aggregates (id) {
494 users_active_day -> Int8,
495 users_active_week -> Int8,
496 users_active_month -> Int8,
497 users_active_half_year -> Int8,
506 published -> Timestamp,
511 community_block (id) {
514 community_id -> Int4,
515 published -> Timestamp,
519 // These are necessary since diesel doesn't have self joins / aliases
521 person_alias_1 (id) {
524 display_name -> Nullable<Varchar>,
525 avatar -> Nullable<Varchar>,
527 published -> Timestamp,
528 updated -> Nullable<Timestamp>,
530 bio -> Nullable<Text>,
532 private_key -> Nullable<Text>,
534 last_refreshed_at -> Timestamp,
535 banner -> Nullable<Varchar>,
537 inbox_url -> Varchar,
538 shared_inbox_url -> Nullable<Varchar>,
539 matrix_user_id -> Nullable<Text>,
542 ban_expires -> Nullable<Timestamp>,
547 person_alias_2 (id) {
550 display_name -> Nullable<Varchar>,
551 avatar -> Nullable<Varchar>,
553 published -> Timestamp,
554 updated -> Nullable<Timestamp>,
556 bio -> Nullable<Text>,
558 private_key -> Nullable<Text>,
560 last_refreshed_at -> Timestamp,
561 banner -> Nullable<Varchar>,
563 inbox_url -> Varchar,
564 shared_inbox_url -> Nullable<Varchar>,
565 matrix_user_id -> Nullable<Text>,
568 ban_expires -> Nullable<Timestamp>,
575 jwt_secret -> Varchar,
580 admin_purge_comment (id) {
582 admin_person_id -> Int4,
584 reason -> Nullable<Text>,
590 email_verification (id) {
592 local_user_id -> Int4,
594 verification_token -> Varchar,
595 published -> Timestamp,
600 admin_purge_community (id) {
602 admin_person_id -> Int4,
603 reason -> Nullable<Text>,
609 admin_purge_person (id) {
611 admin_person_id -> Int4,
612 reason -> Nullable<Text>,
618 admin_purge_post (id) {
620 admin_person_id -> Int4,
621 community_id -> Int4,
622 reason -> Nullable<Text>,
628 registration_application (id) {
630 local_user_id -> Int4,
632 admin_id -> Nullable<Int4>,
633 deny_reason -> Nullable<Text>,
634 published -> Timestamp,
639 mod_hide_community (id) {
641 community_id -> Int4,
642 mod_person_id -> Int4,
643 reason -> Nullable<Text>,
644 hidden -> Nullable<Bool>,
658 local_user_language(id) {
660 local_user_id -> Int4,
665 joinable!(person_mention -> person_alias_1 (recipient_id));
666 joinable!(comment_reply -> person_alias_1 (recipient_id));
667 joinable!(post -> person_alias_1 (creator_id));
668 joinable!(comment -> person_alias_1 (creator_id));
670 joinable!(post_report -> person_alias_2 (resolver_id));
671 joinable!(comment_report -> person_alias_2 (resolver_id));
673 joinable!(person_block -> person (person_id));
674 joinable!(person_block -> person_alias_1 (target_id));
676 joinable!(comment -> person (creator_id));
677 joinable!(comment -> post (post_id));
678 joinable!(comment_aggregates -> comment (comment_id));
679 joinable!(comment_like -> comment (comment_id));
680 joinable!(comment_like -> person (person_id));
681 joinable!(comment_like -> post (post_id));
682 joinable!(comment_report -> comment (comment_id));
683 joinable!(comment_saved -> comment (comment_id));
684 joinable!(comment_saved -> person (person_id));
685 joinable!(community_aggregates -> community (community_id));
686 joinable!(community_block -> community (community_id));
687 joinable!(community_block -> person (person_id));
688 joinable!(community_follower -> community (community_id));
689 joinable!(community_follower -> person (person_id));
690 joinable!(community_moderator -> community (community_id));
691 joinable!(community_moderator -> person (person_id));
692 joinable!(community_person_ban -> community (community_id));
693 joinable!(community_person_ban -> person (person_id));
694 joinable!(local_user -> person (person_id));
695 joinable!(mod_add_community -> community (community_id));
696 joinable!(mod_transfer_community -> community (community_id));
697 joinable!(mod_ban_from_community -> community (community_id));
698 joinable!(mod_lock_post -> person (mod_person_id));
699 joinable!(mod_lock_post -> post (post_id));
700 joinable!(mod_remove_comment -> comment (comment_id));
701 joinable!(mod_remove_comment -> person (mod_person_id));
702 joinable!(mod_remove_community -> community (community_id));
703 joinable!(mod_remove_community -> person (mod_person_id));
704 joinable!(mod_remove_post -> person (mod_person_id));
705 joinable!(mod_remove_post -> post (post_id));
706 joinable!(mod_sticky_post -> person (mod_person_id));
707 joinable!(mod_sticky_post -> post (post_id));
708 joinable!(password_reset_request -> local_user (local_user_id));
709 joinable!(person_aggregates -> person (person_id));
710 joinable!(person_ban -> person (person_id));
711 joinable!(person_mention -> comment (comment_id));
712 joinable!(person_mention -> person (recipient_id));
713 joinable!(comment_reply -> comment (comment_id));
714 joinable!(comment_reply -> person (recipient_id));
715 joinable!(post -> community (community_id));
716 joinable!(post -> person (creator_id));
717 joinable!(post_aggregates -> post (post_id));
718 joinable!(post_like -> person (person_id));
719 joinable!(post_like -> post (post_id));
720 joinable!(post_read -> person (person_id));
721 joinable!(post_read -> post (post_id));
722 joinable!(post_report -> post (post_id));
723 joinable!(post_saved -> person (person_id));
724 joinable!(post_saved -> post (post_id));
725 joinable!(site_aggregates -> site (site_id));
726 joinable!(email_verification -> local_user (local_user_id));
727 joinable!(registration_application -> local_user (local_user_id));
728 joinable!(registration_application -> person (admin_id));
729 joinable!(mod_hide_community -> person (mod_person_id));
730 joinable!(mod_hide_community -> community (community_id));
731 joinable!(post -> language (language_id));
732 joinable!(local_user_language -> language (language_id));
733 joinable!(local_user_language -> local_user (local_user_id));
735 joinable!(admin_purge_comment -> person (admin_person_id));
736 joinable!(admin_purge_comment -> post (post_id));
737 joinable!(admin_purge_community -> person (admin_person_id));
738 joinable!(admin_purge_person -> person (admin_person_id));
739 joinable!(admin_purge_post -> community (community_id));
740 joinable!(admin_purge_post -> person (admin_person_id));
742 allow_tables_to_appear_in_same_query!(
751 community_aggregates,
754 community_person_ban,
758 mod_transfer_community,
760 mod_ban_from_community,
763 mod_remove_community,
767 password_reset_request,
786 admin_purge_community,
790 registration_application,