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 email_verification (id) {
583 local_user_id -> Int4,
585 verification_token -> Varchar,
586 published -> Timestamp,
591 registration_application (id) {
593 local_user_id -> Int4,
595 admin_id -> Nullable<Int4>,
596 deny_reason -> Nullable<Text>,
597 published -> Timestamp,
602 mod_hide_community (id) {
604 community_id -> Int4,
605 mod_person_id -> Int4,
606 reason -> Nullable<Text>,
607 hidden -> Nullable<Bool>,
612 joinable!(comment_alias_1 -> person_alias_1 (creator_id));
613 joinable!(comment -> comment_alias_1 (parent_id));
614 joinable!(person_mention -> person_alias_1 (recipient_id));
615 joinable!(post -> person_alias_1 (creator_id));
616 joinable!(comment -> person_alias_1 (creator_id));
618 joinable!(post_report -> person_alias_2 (resolver_id));
619 joinable!(comment_report -> person_alias_2 (resolver_id));
621 joinable!(person_block -> person (person_id));
622 joinable!(person_block -> person_alias_1 (target_id));
624 joinable!(comment -> person (creator_id));
625 joinable!(comment -> post (post_id));
626 joinable!(comment_aggregates -> comment (comment_id));
627 joinable!(comment_like -> comment (comment_id));
628 joinable!(comment_like -> person (person_id));
629 joinable!(comment_like -> post (post_id));
630 joinable!(comment_report -> comment (comment_id));
631 joinable!(comment_saved -> comment (comment_id));
632 joinable!(comment_saved -> person (person_id));
633 joinable!(community_aggregates -> community (community_id));
634 joinable!(community_block -> community (community_id));
635 joinable!(community_block -> person (person_id));
636 joinable!(community_follower -> community (community_id));
637 joinable!(community_follower -> person (person_id));
638 joinable!(community_moderator -> community (community_id));
639 joinable!(community_moderator -> person (person_id));
640 joinable!(community_person_ban -> community (community_id));
641 joinable!(community_person_ban -> person (person_id));
642 joinable!(local_user -> person (person_id));
643 joinable!(mod_add_community -> community (community_id));
644 joinable!(mod_transfer_community -> community (community_id));
645 joinable!(mod_ban_from_community -> community (community_id));
646 joinable!(mod_lock_post -> person (mod_person_id));
647 joinable!(mod_lock_post -> post (post_id));
648 joinable!(mod_remove_comment -> comment (comment_id));
649 joinable!(mod_remove_comment -> person (mod_person_id));
650 joinable!(mod_remove_community -> community (community_id));
651 joinable!(mod_remove_community -> person (mod_person_id));
652 joinable!(mod_remove_post -> person (mod_person_id));
653 joinable!(mod_remove_post -> post (post_id));
654 joinable!(mod_sticky_post -> person (mod_person_id));
655 joinable!(mod_sticky_post -> post (post_id));
656 joinable!(password_reset_request -> local_user (local_user_id));
657 joinable!(person_aggregates -> person (person_id));
658 joinable!(person_ban -> person (person_id));
659 joinable!(person_mention -> comment (comment_id));
660 joinable!(person_mention -> person (recipient_id));
661 joinable!(post -> community (community_id));
662 joinable!(post -> person (creator_id));
663 joinable!(post_aggregates -> post (post_id));
664 joinable!(post_like -> person (person_id));
665 joinable!(post_like -> post (post_id));
666 joinable!(post_read -> person (person_id));
667 joinable!(post_read -> post (post_id));
668 joinable!(post_report -> post (post_id));
669 joinable!(post_saved -> person (person_id));
670 joinable!(post_saved -> post (post_id));
671 joinable!(site_aggregates -> site (site_id));
672 joinable!(email_verification -> local_user (local_user_id));
673 joinable!(registration_application -> local_user (local_user_id));
674 joinable!(registration_application -> person (admin_id));
675 joinable!(mod_hide_community -> person (mod_person_id));
676 joinable!(mod_hide_community -> community (community_id));
678 allow_tables_to_appear_in_same_query!(
687 community_aggregates,
690 community_person_ban,
694 mod_transfer_community,
696 mod_ban_from_community,
699 mod_remove_community,
703 password_reset_request,
722 registration_application