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>,
33 comment_aggregates (id) {
39 published -> Timestamp,
51 published -> Timestamp,
60 original_comment_text -> Text,
63 resolver_id -> Nullable<Int4>,
64 published -> Timestamp,
65 updated -> Nullable<Timestamp>,
74 published -> Timestamp,
83 description -> Nullable<Text>,
85 published -> Timestamp,
86 updated -> Nullable<Timestamp>,
91 private_key -> Nullable<Text>,
93 last_refreshed_at -> Timestamp,
94 icon -> Nullable<Varchar>,
95 banner -> Nullable<Varchar>,
96 followers_url -> Varchar,
98 shared_inbox_url -> Nullable<Varchar>,
100 posting_restricted_to_mods -> Bool,
105 community_aggregates (id) {
107 community_id -> Int4,
111 published -> Timestamp,
112 users_active_day -> Int8,
113 users_active_week -> Int8,
114 users_active_month -> Int8,
115 users_active_half_year -> Int8,
120 community_follower (id) {
122 community_id -> Int4,
124 published -> Timestamp,
125 pending -> Nullable<Bool>,
130 community_moderator (id) {
132 community_id -> Int4,
134 published -> Timestamp,
139 community_person_ban (id) {
141 community_id -> Int4,
143 published -> Timestamp,
144 expires -> Nullable<Timestamp>,
152 password_encrypted -> Text,
153 email -> Nullable<Text>,
156 default_sort_type -> Int2,
157 default_listing_type -> Int2,
159 show_avatars -> Bool,
160 send_notifications_to_email -> Bool,
161 validator_time -> Timestamp,
162 show_bot_accounts -> Bool,
164 show_read_posts -> Bool,
165 show_new_post_notifs -> Bool,
166 email_verified -> Bool,
167 accepted_application -> Bool,
174 mod_person_id -> Int4,
175 other_person_id -> Int4,
176 removed -> Nullable<Bool>,
182 mod_add_community (id) {
184 mod_person_id -> Int4,
185 other_person_id -> Int4,
186 community_id -> Int4,
187 removed -> Nullable<Bool>,
193 mod_transfer_community (id) {
195 mod_person_id -> Int4,
196 other_person_id -> Int4,
197 community_id -> Int4,
198 removed -> Nullable<Bool>,
206 mod_person_id -> Int4,
207 other_person_id -> Int4,
208 reason -> Nullable<Text>,
209 banned -> Nullable<Bool>,
210 expires -> Nullable<Timestamp>,
216 mod_ban_from_community (id) {
218 mod_person_id -> Int4,
219 other_person_id -> Int4,
220 community_id -> Int4,
221 reason -> Nullable<Text>,
222 banned -> Nullable<Bool>,
223 expires -> Nullable<Timestamp>,
231 mod_person_id -> Int4,
233 locked -> Nullable<Bool>,
239 mod_remove_comment (id) {
241 mod_person_id -> Int4,
243 reason -> Nullable<Text>,
244 removed -> Nullable<Bool>,
250 mod_remove_community (id) {
252 mod_person_id -> Int4,
253 community_id -> Int4,
254 reason -> Nullable<Text>,
255 removed -> Nullable<Bool>,
256 expires -> Nullable<Timestamp>,
262 mod_remove_post (id) {
264 mod_person_id -> Int4,
266 reason -> Nullable<Text>,
267 removed -> Nullable<Bool>,
273 mod_sticky_post (id) {
275 mod_person_id -> Int4,
277 stickied -> Nullable<Bool>,
283 password_reset_request (id) {
285 token_encrypted -> Text,
286 published -> Timestamp,
287 local_user_id -> Int4,
295 display_name -> Nullable<Varchar>,
296 avatar -> Nullable<Varchar>,
298 published -> Timestamp,
299 updated -> Nullable<Timestamp>,
301 bio -> Nullable<Text>,
303 private_key -> Nullable<Text>,
305 last_refreshed_at -> Timestamp,
306 banner -> Nullable<Varchar>,
308 inbox_url -> Varchar,
309 shared_inbox_url -> Nullable<Varchar>,
310 matrix_user_id -> Nullable<Text>,
313 ban_expires -> Nullable<Timestamp>,
318 person_aggregates (id) {
323 comment_count -> Int8,
324 comment_score -> Int8,
332 published -> Timestamp,
337 person_mention (id) {
339 recipient_id -> Int4,
342 published -> Timestamp,
349 recipient_id -> Int4,
352 published -> Timestamp,
360 url -> Nullable<Varchar>,
361 body -> Nullable<Text>,
363 community_id -> Int4,
366 published -> Timestamp,
367 updated -> Nullable<Timestamp>,
371 embed_title -> Nullable<Text>,
372 embed_description -> Nullable<Text>,
373 embed_video_url -> Nullable<Text>,
374 thumbnail_url -> Nullable<Text>,
381 post_aggregates (id) {
389 published -> Timestamp,
390 newest_comment_time_necro -> Timestamp,
391 newest_comment_time -> Timestamp,
401 published -> Timestamp,
410 published -> Timestamp,
419 original_post_name -> Varchar,
420 original_post_url -> Nullable<Text>,
421 original_post_body -> Nullable<Text>,
424 resolver_id -> Nullable<Int4>,
425 published -> Timestamp,
426 updated -> Nullable<Timestamp>,
435 published -> Timestamp,
440 private_message (id) {
443 recipient_id -> Int4,
447 published -> Timestamp,
448 updated -> Nullable<Timestamp>,
458 sidebar -> Nullable<Text>,
459 published -> Timestamp,
460 updated -> Nullable<Timestamp>,
461 enable_downvotes -> Bool,
462 open_registration -> Bool,
464 icon -> Nullable<Varchar>,
465 banner -> Nullable<Varchar>,
466 description -> Nullable<Text>,
467 community_creation_admin_only -> Bool,
468 require_email_verification -> Bool,
469 require_application -> Bool,
470 application_question -> Nullable<Text>,
471 private_instance -> Bool,
473 last_refreshed_at -> Timestamp,
475 private_key -> Nullable<Text>,
477 default_theme -> Text,
478 default_post_listing_type -> Text,
479 legal_information -> Nullable<Text>,
480 hide_modlog_mod_names -> Bool,
485 site_aggregates (id) {
492 users_active_day -> Int8,
493 users_active_week -> Int8,
494 users_active_month -> Int8,
495 users_active_half_year -> Int8,
504 published -> Timestamp,
509 community_block (id) {
512 community_id -> Int4,
513 published -> Timestamp,
517 // These are necessary since diesel doesn't have self joins / aliases
519 person_alias_1 (id) {
522 display_name -> Nullable<Varchar>,
523 avatar -> Nullable<Varchar>,
525 published -> Timestamp,
526 updated -> Nullable<Timestamp>,
528 bio -> Nullable<Text>,
530 private_key -> Nullable<Text>,
532 last_refreshed_at -> Timestamp,
533 banner -> Nullable<Varchar>,
535 inbox_url -> Varchar,
536 shared_inbox_url -> Nullable<Varchar>,
537 matrix_user_id -> Nullable<Text>,
540 ban_expires -> Nullable<Timestamp>,
545 person_alias_2 (id) {
548 display_name -> Nullable<Varchar>,
549 avatar -> Nullable<Varchar>,
551 published -> Timestamp,
552 updated -> Nullable<Timestamp>,
554 bio -> Nullable<Text>,
556 private_key -> Nullable<Text>,
558 last_refreshed_at -> Timestamp,
559 banner -> Nullable<Varchar>,
561 inbox_url -> Varchar,
562 shared_inbox_url -> Nullable<Varchar>,
563 matrix_user_id -> Nullable<Text>,
566 ban_expires -> Nullable<Timestamp>,
573 jwt_secret -> Varchar,
578 admin_purge_comment (id) {
580 admin_person_id -> Int4,
582 reason -> Nullable<Text>,
588 email_verification (id) {
590 local_user_id -> Int4,
592 verification_token -> Varchar,
593 published -> Timestamp,
598 admin_purge_community (id) {
600 admin_person_id -> Int4,
601 reason -> Nullable<Text>,
607 admin_purge_person (id) {
609 admin_person_id -> Int4,
610 reason -> Nullable<Text>,
616 admin_purge_post (id) {
618 admin_person_id -> Int4,
619 community_id -> Int4,
620 reason -> Nullable<Text>,
626 registration_application (id) {
628 local_user_id -> Int4,
630 admin_id -> Nullable<Int4>,
631 deny_reason -> Nullable<Text>,
632 published -> Timestamp,
637 mod_hide_community (id) {
639 community_id -> Int4,
640 mod_person_id -> Int4,
641 reason -> Nullable<Text>,
642 hidden -> Nullable<Bool>,
647 joinable!(person_mention -> person_alias_1 (recipient_id));
648 joinable!(comment_reply -> person_alias_1 (recipient_id));
649 joinable!(post -> person_alias_1 (creator_id));
650 joinable!(comment -> person_alias_1 (creator_id));
652 joinable!(post_report -> person_alias_2 (resolver_id));
653 joinable!(comment_report -> person_alias_2 (resolver_id));
655 joinable!(person_block -> person (person_id));
656 joinable!(person_block -> person_alias_1 (target_id));
658 joinable!(comment -> person (creator_id));
659 joinable!(comment -> post (post_id));
660 joinable!(comment_aggregates -> comment (comment_id));
661 joinable!(comment_like -> comment (comment_id));
662 joinable!(comment_like -> person (person_id));
663 joinable!(comment_like -> post (post_id));
664 joinable!(comment_report -> comment (comment_id));
665 joinable!(comment_saved -> comment (comment_id));
666 joinable!(comment_saved -> person (person_id));
667 joinable!(community_aggregates -> community (community_id));
668 joinable!(community_block -> community (community_id));
669 joinable!(community_block -> person (person_id));
670 joinable!(community_follower -> community (community_id));
671 joinable!(community_follower -> person (person_id));
672 joinable!(community_moderator -> community (community_id));
673 joinable!(community_moderator -> person (person_id));
674 joinable!(community_person_ban -> community (community_id));
675 joinable!(community_person_ban -> person (person_id));
676 joinable!(local_user -> person (person_id));
677 joinable!(mod_add_community -> community (community_id));
678 joinable!(mod_transfer_community -> community (community_id));
679 joinable!(mod_ban_from_community -> community (community_id));
680 joinable!(mod_lock_post -> person (mod_person_id));
681 joinable!(mod_lock_post -> post (post_id));
682 joinable!(mod_remove_comment -> comment (comment_id));
683 joinable!(mod_remove_comment -> person (mod_person_id));
684 joinable!(mod_remove_community -> community (community_id));
685 joinable!(mod_remove_community -> person (mod_person_id));
686 joinable!(mod_remove_post -> person (mod_person_id));
687 joinable!(mod_remove_post -> post (post_id));
688 joinable!(mod_sticky_post -> person (mod_person_id));
689 joinable!(mod_sticky_post -> post (post_id));
690 joinable!(password_reset_request -> local_user (local_user_id));
691 joinable!(person_aggregates -> person (person_id));
692 joinable!(person_ban -> person (person_id));
693 joinable!(person_mention -> comment (comment_id));
694 joinable!(person_mention -> person (recipient_id));
695 joinable!(comment_reply -> comment (comment_id));
696 joinable!(comment_reply -> person (recipient_id));
697 joinable!(post -> community (community_id));
698 joinable!(post -> person (creator_id));
699 joinable!(post_aggregates -> post (post_id));
700 joinable!(post_like -> person (person_id));
701 joinable!(post_like -> post (post_id));
702 joinable!(post_read -> person (person_id));
703 joinable!(post_read -> post (post_id));
704 joinable!(post_report -> post (post_id));
705 joinable!(post_saved -> person (person_id));
706 joinable!(post_saved -> post (post_id));
707 joinable!(site_aggregates -> site (site_id));
708 joinable!(email_verification -> local_user (local_user_id));
709 joinable!(registration_application -> local_user (local_user_id));
710 joinable!(registration_application -> person (admin_id));
711 joinable!(mod_hide_community -> person (mod_person_id));
712 joinable!(mod_hide_community -> community (community_id));
714 joinable!(admin_purge_comment -> person (admin_person_id));
715 joinable!(admin_purge_comment -> post (post_id));
716 joinable!(admin_purge_community -> person (admin_person_id));
717 joinable!(admin_purge_person -> person (admin_person_id));
718 joinable!(admin_purge_post -> community (community_id));
719 joinable!(admin_purge_post -> person (admin_person_id));
721 allow_tables_to_appear_in_same_query!(
730 community_aggregates,
733 community_person_ban,
737 mod_transfer_community,
739 mod_ban_from_community,
742 mod_remove_community,
746 password_reset_request,
765 admin_purge_community,
769 registration_application