6 published -> Timestamp,
7 updated -> Nullable<Timestamp>,
9 sensitive -> Nullable<Bool>,
18 parent_id -> Nullable<Int4>,
22 published -> Timestamp,
23 updated -> Nullable<Timestamp>,
31 comment_aggregates (id) {
37 published -> Timestamp,
48 published -> Timestamp,
57 original_comment_text -> Text,
60 resolver_id -> Nullable<Int4>,
61 published -> Timestamp,
62 updated -> Nullable<Timestamp>,
71 published -> Timestamp,
80 description -> Nullable<Text>,
82 published -> Timestamp,
83 updated -> Nullable<Timestamp>,
88 private_key -> Nullable<Text>,
90 last_refreshed_at -> Timestamp,
91 icon -> Nullable<Varchar>,
92 banner -> Nullable<Varchar>,
93 followers_url -> Varchar,
95 shared_inbox_url -> Nullable<Varchar>,
97 posting_restricted_to_mods -> Bool,
102 community_aggregates (id) {
104 community_id -> Int4,
108 published -> Timestamp,
109 users_active_day -> Int8,
110 users_active_week -> Int8,
111 users_active_month -> Int8,
112 users_active_half_year -> Int8,
117 community_follower (id) {
119 community_id -> Int4,
121 published -> Timestamp,
122 pending -> Nullable<Bool>,
127 community_moderator (id) {
129 community_id -> Int4,
131 published -> Timestamp,
136 community_person_ban (id) {
138 community_id -> Int4,
140 published -> Timestamp,
141 expires -> Nullable<Timestamp>,
149 password_encrypted -> Text,
150 email -> Nullable<Text>,
153 default_sort_type -> Int2,
154 default_listing_type -> Int2,
156 show_avatars -> Bool,
157 send_notifications_to_email -> Bool,
158 validator_time -> Timestamp,
159 show_bot_accounts -> Bool,
161 show_read_posts -> Bool,
162 show_new_post_notifs -> Bool,
163 email_verified -> Bool,
164 accepted_application -> Bool,
171 mod_person_id -> Int4,
172 other_person_id -> Int4,
173 removed -> Nullable<Bool>,
179 mod_add_community (id) {
181 mod_person_id -> Int4,
182 other_person_id -> Int4,
183 community_id -> Int4,
184 removed -> Nullable<Bool>,
190 mod_transfer_community (id) {
192 mod_person_id -> Int4,
193 other_person_id -> Int4,
194 community_id -> Int4,
195 removed -> Nullable<Bool>,
203 mod_person_id -> Int4,
204 other_person_id -> Int4,
205 reason -> Nullable<Text>,
206 banned -> Nullable<Bool>,
207 expires -> Nullable<Timestamp>,
213 mod_ban_from_community (id) {
215 mod_person_id -> Int4,
216 other_person_id -> Int4,
217 community_id -> Int4,
218 reason -> Nullable<Text>,
219 banned -> Nullable<Bool>,
220 expires -> Nullable<Timestamp>,
228 mod_person_id -> Int4,
230 locked -> Nullable<Bool>,
236 mod_remove_comment (id) {
238 mod_person_id -> Int4,
240 reason -> Nullable<Text>,
241 removed -> Nullable<Bool>,
247 mod_remove_community (id) {
249 mod_person_id -> Int4,
250 community_id -> Int4,
251 reason -> Nullable<Text>,
252 removed -> Nullable<Bool>,
253 expires -> Nullable<Timestamp>,
259 mod_remove_post (id) {
261 mod_person_id -> Int4,
263 reason -> Nullable<Text>,
264 removed -> Nullable<Bool>,
270 mod_sticky_post (id) {
272 mod_person_id -> Int4,
274 stickied -> Nullable<Bool>,
280 password_reset_request (id) {
282 token_encrypted -> Text,
283 published -> Timestamp,
284 local_user_id -> Int4,
292 display_name -> Nullable<Varchar>,
293 avatar -> Nullable<Varchar>,
295 published -> Timestamp,
296 updated -> Nullable<Timestamp>,
298 bio -> Nullable<Text>,
300 private_key -> Nullable<Text>,
302 last_refreshed_at -> Timestamp,
303 banner -> Nullable<Varchar>,
305 inbox_url -> Varchar,
306 shared_inbox_url -> Nullable<Varchar>,
307 matrix_user_id -> Nullable<Text>,
310 ban_expires -> Nullable<Timestamp>,
315 person_aggregates (id) {
320 comment_count -> Int8,
321 comment_score -> Int8,
329 published -> Timestamp,
334 person_mention (id) {
336 recipient_id -> Int4,
339 published -> Timestamp,
347 url -> Nullable<Varchar>,
348 body -> Nullable<Text>,
350 community_id -> Int4,
353 published -> Timestamp,
354 updated -> Nullable<Timestamp>,
358 embed_title -> Nullable<Text>,
359 embed_description -> Nullable<Text>,
360 embed_video_url -> Nullable<Text>,
361 thumbnail_url -> Nullable<Text>,
368 post_aggregates (id) {
376 published -> Timestamp,
377 newest_comment_time_necro -> Timestamp,
378 newest_comment_time -> Timestamp,
388 published -> Timestamp,
397 published -> Timestamp,
406 original_post_name -> Varchar,
407 original_post_url -> Nullable<Text>,
408 original_post_body -> Nullable<Text>,
411 resolver_id -> Nullable<Int4>,
412 published -> Timestamp,
413 updated -> Nullable<Timestamp>,
422 published -> Timestamp,
427 private_message (id) {
430 recipient_id -> Int4,
434 published -> Timestamp,
435 updated -> Nullable<Timestamp>,
445 sidebar -> Nullable<Text>,
446 published -> Timestamp,
447 updated -> Nullable<Timestamp>,
448 enable_downvotes -> Bool,
449 open_registration -> Bool,
451 icon -> Nullable<Varchar>,
452 banner -> Nullable<Varchar>,
453 description -> Nullable<Text>,
454 community_creation_admin_only -> Bool,
455 require_email_verification -> Bool,
456 require_application -> Bool,
457 application_question -> Nullable<Text>,
458 private_instance -> Bool,
460 last_refreshed_at -> Timestamp,
462 private_key -> Nullable<Text>,
464 default_theme -> Text,
465 default_post_listing_type -> Text,
466 legal_information -> Nullable<Text>,
471 site_aggregates (id) {
478 users_active_day -> Int8,
479 users_active_week -> Int8,
480 users_active_month -> Int8,
481 users_active_half_year -> Int8,
490 published -> Timestamp,
495 community_block (id) {
498 community_id -> Int4,
499 published -> Timestamp,
503 // These are necessary since diesel doesn't have self joins / aliases
505 comment_alias_1 (id) {
509 parent_id -> Nullable<Int4>,
513 published -> Timestamp,
514 updated -> Nullable<Timestamp>,
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>,
650 joinable!(comment_alias_1 -> person_alias_1 (creator_id));
651 joinable!(comment -> comment_alias_1 (parent_id));
652 joinable!(person_mention -> person_alias_1 (recipient_id));
653 joinable!(post -> person_alias_1 (creator_id));
654 joinable!(comment -> person_alias_1 (creator_id));
656 joinable!(post_report -> person_alias_2 (resolver_id));
657 joinable!(comment_report -> person_alias_2 (resolver_id));
659 joinable!(person_block -> person (person_id));
660 joinable!(person_block -> person_alias_1 (target_id));
662 joinable!(comment -> person (creator_id));
663 joinable!(comment -> post (post_id));
664 joinable!(comment_aggregates -> comment (comment_id));
665 joinable!(comment_like -> comment (comment_id));
666 joinable!(comment_like -> person (person_id));
667 joinable!(comment_like -> post (post_id));
668 joinable!(comment_report -> comment (comment_id));
669 joinable!(comment_saved -> comment (comment_id));
670 joinable!(comment_saved -> person (person_id));
671 joinable!(community_aggregates -> community (community_id));
672 joinable!(community_block -> community (community_id));
673 joinable!(community_block -> person (person_id));
674 joinable!(community_follower -> community (community_id));
675 joinable!(community_follower -> person (person_id));
676 joinable!(community_moderator -> community (community_id));
677 joinable!(community_moderator -> person (person_id));
678 joinable!(community_person_ban -> community (community_id));
679 joinable!(community_person_ban -> person (person_id));
680 joinable!(local_user -> person (person_id));
681 joinable!(mod_add_community -> community (community_id));
682 joinable!(mod_transfer_community -> community (community_id));
683 joinable!(mod_ban_from_community -> community (community_id));
684 joinable!(mod_lock_post -> person (mod_person_id));
685 joinable!(mod_lock_post -> post (post_id));
686 joinable!(mod_remove_comment -> comment (comment_id));
687 joinable!(mod_remove_comment -> person (mod_person_id));
688 joinable!(mod_remove_community -> community (community_id));
689 joinable!(mod_remove_community -> person (mod_person_id));
690 joinable!(mod_remove_post -> person (mod_person_id));
691 joinable!(mod_remove_post -> post (post_id));
692 joinable!(mod_sticky_post -> person (mod_person_id));
693 joinable!(mod_sticky_post -> post (post_id));
694 joinable!(password_reset_request -> local_user (local_user_id));
695 joinable!(person_aggregates -> person (person_id));
696 joinable!(person_ban -> person (person_id));
697 joinable!(person_mention -> comment (comment_id));
698 joinable!(person_mention -> person (recipient_id));
699 joinable!(post -> community (community_id));
700 joinable!(post -> person (creator_id));
701 joinable!(post_aggregates -> post (post_id));
702 joinable!(post_like -> person (person_id));
703 joinable!(post_like -> post (post_id));
704 joinable!(post_read -> person (person_id));
705 joinable!(post_read -> post (post_id));
706 joinable!(post_report -> post (post_id));
707 joinable!(post_saved -> person (person_id));
708 joinable!(post_saved -> post (post_id));
709 joinable!(site_aggregates -> site (site_id));
710 joinable!(email_verification -> local_user (local_user_id));
711 joinable!(registration_application -> local_user (local_user_id));
712 joinable!(registration_application -> person (admin_id));
713 joinable!(mod_hide_community -> person (mod_person_id));
714 joinable!(mod_hide_community -> community (community_id));
716 joinable!(admin_purge_comment -> person (admin_person_id));
717 joinable!(admin_purge_comment -> post (post_id));
718 joinable!(admin_purge_community -> person (admin_person_id));
719 joinable!(admin_purge_person -> person (admin_person_id));
720 joinable!(admin_purge_post -> community (community_id));
721 joinable!(admin_purge_post -> person (admin_person_id));
723 allow_tables_to_appear_in_same_query!(
732 community_aggregates,
735 community_person_ban,
739 mod_transfer_community,
741 mod_ban_from_community,
744 mod_remove_community,
748 password_reset_request,
767 admin_purge_community,
771 registration_application