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>,
101 community_aggregates (id) {
103 community_id -> Int4,
107 published -> Timestamp,
108 users_active_day -> Int8,
109 users_active_week -> Int8,
110 users_active_month -> Int8,
111 users_active_half_year -> Int8,
116 community_follower (id) {
118 community_id -> Int4,
120 published -> Timestamp,
121 pending -> Nullable<Bool>,
126 community_moderator (id) {
128 community_id -> Int4,
130 published -> Timestamp,
135 community_person_ban (id) {
137 community_id -> Int4,
139 published -> Timestamp,
140 expires -> Nullable<Timestamp>,
148 password_encrypted -> Text,
149 email -> Nullable<Text>,
152 default_sort_type -> Int2,
153 default_listing_type -> Int2,
155 show_avatars -> Bool,
156 send_notifications_to_email -> Bool,
157 validator_time -> Timestamp,
158 show_bot_accounts -> Bool,
160 show_read_posts -> Bool,
161 show_new_post_notifs -> Bool,
162 email_verified -> Bool,
163 accepted_application -> Bool,
170 mod_person_id -> Int4,
171 other_person_id -> Int4,
172 removed -> Nullable<Bool>,
178 mod_add_community (id) {
180 mod_person_id -> Int4,
181 other_person_id -> Int4,
182 community_id -> Int4,
183 removed -> Nullable<Bool>,
189 mod_transfer_community (id) {
191 mod_person_id -> Int4,
192 other_person_id -> Int4,
193 community_id -> Int4,
194 removed -> Nullable<Bool>,
202 mod_person_id -> Int4,
203 other_person_id -> Int4,
204 reason -> Nullable<Text>,
205 banned -> Nullable<Bool>,
206 expires -> Nullable<Timestamp>,
212 mod_ban_from_community (id) {
214 mod_person_id -> Int4,
215 other_person_id -> Int4,
216 community_id -> Int4,
217 reason -> Nullable<Text>,
218 banned -> Nullable<Bool>,
219 expires -> Nullable<Timestamp>,
227 mod_person_id -> Int4,
229 locked -> Nullable<Bool>,
235 mod_remove_comment (id) {
237 mod_person_id -> Int4,
239 reason -> Nullable<Text>,
240 removed -> Nullable<Bool>,
246 mod_remove_community (id) {
248 mod_person_id -> Int4,
249 community_id -> Int4,
250 reason -> Nullable<Text>,
251 removed -> Nullable<Bool>,
252 expires -> Nullable<Timestamp>,
258 mod_remove_post (id) {
260 mod_person_id -> Int4,
262 reason -> Nullable<Text>,
263 removed -> Nullable<Bool>,
269 mod_sticky_post (id) {
271 mod_person_id -> Int4,
273 stickied -> Nullable<Bool>,
279 password_reset_request (id) {
281 token_encrypted -> Text,
282 published -> Timestamp,
283 local_user_id -> Int4,
291 display_name -> Nullable<Varchar>,
292 avatar -> Nullable<Varchar>,
294 published -> Timestamp,
295 updated -> Nullable<Timestamp>,
297 bio -> Nullable<Text>,
299 private_key -> Nullable<Text>,
301 last_refreshed_at -> Timestamp,
302 banner -> Nullable<Varchar>,
304 inbox_url -> Varchar,
305 shared_inbox_url -> Nullable<Varchar>,
306 matrix_user_id -> Nullable<Text>,
309 ban_expires -> Nullable<Timestamp>,
314 person_aggregates (id) {
319 comment_count -> Int8,
320 comment_score -> Int8,
328 published -> Timestamp,
333 person_mention (id) {
335 recipient_id -> Int4,
338 published -> Timestamp,
346 url -> Nullable<Varchar>,
347 body -> Nullable<Text>,
349 community_id -> Int4,
352 published -> Timestamp,
353 updated -> Nullable<Timestamp>,
357 embed_title -> Nullable<Text>,
358 embed_description -> Nullable<Text>,
359 embed_html -> Nullable<Text>,
360 thumbnail_url -> Nullable<Text>,
367 post_aggregates (id) {
375 published -> Timestamp,
376 newest_comment_time_necro -> Timestamp,
377 newest_comment_time -> Timestamp,
387 published -> Timestamp,
396 published -> Timestamp,
405 original_post_name -> Varchar,
406 original_post_url -> Nullable<Text>,
407 original_post_body -> Nullable<Text>,
410 resolver_id -> Nullable<Int4>,
411 published -> Timestamp,
412 updated -> Nullable<Timestamp>,
421 published -> Timestamp,
426 private_message (id) {
429 recipient_id -> Int4,
433 published -> Timestamp,
434 updated -> Nullable<Timestamp>,
444 sidebar -> Nullable<Text>,
445 published -> Timestamp,
446 updated -> Nullable<Timestamp>,
447 enable_downvotes -> Bool,
448 open_registration -> Bool,
450 icon -> Nullable<Varchar>,
451 banner -> Nullable<Varchar>,
452 description -> Nullable<Text>,
453 community_creation_admin_only -> Bool,
454 require_email_verification -> Bool,
455 require_application -> Bool,
456 application_question -> Nullable<Text>,
457 private_instance -> Bool,
459 last_refreshed_at -> Timestamp,
461 private_key -> Nullable<Text>,
463 default_theme -> Text,
468 site_aggregates (id) {
475 users_active_day -> Int8,
476 users_active_week -> Int8,
477 users_active_month -> Int8,
478 users_active_half_year -> Int8,
487 published -> Timestamp,
492 community_block (id) {
495 community_id -> Int4,
496 published -> Timestamp,
500 // These are necessary since diesel doesn't have self joins / aliases
502 comment_alias_1 (id) {
506 parent_id -> Nullable<Int4>,
510 published -> Timestamp,
511 updated -> Nullable<Timestamp>,
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 email_verification (id) {
580 local_user_id -> Int4,
582 verification_token -> Varchar,
583 published -> Timestamp,
588 registration_application (id) {
590 local_user_id -> Int4,
592 admin_id -> Nullable<Int4>,
593 deny_reason -> Nullable<Text>,
594 published -> Timestamp,
599 mod_hide_community (id) {
601 community_id -> Int4,
602 mod_person_id -> Int4,
603 reason -> Nullable<Text>,
604 hidden -> Nullable<Bool>,
609 joinable!(comment_alias_1 -> person_alias_1 (creator_id));
610 joinable!(comment -> comment_alias_1 (parent_id));
611 joinable!(person_mention -> person_alias_1 (recipient_id));
612 joinable!(post -> person_alias_1 (creator_id));
613 joinable!(comment -> person_alias_1 (creator_id));
615 joinable!(post_report -> person_alias_2 (resolver_id));
616 joinable!(comment_report -> person_alias_2 (resolver_id));
618 joinable!(person_block -> person (person_id));
619 joinable!(person_block -> person_alias_1 (target_id));
621 joinable!(comment -> person (creator_id));
622 joinable!(comment -> post (post_id));
623 joinable!(comment_aggregates -> comment (comment_id));
624 joinable!(comment_like -> comment (comment_id));
625 joinable!(comment_like -> person (person_id));
626 joinable!(comment_like -> post (post_id));
627 joinable!(comment_report -> comment (comment_id));
628 joinable!(comment_saved -> comment (comment_id));
629 joinable!(comment_saved -> person (person_id));
630 joinable!(community_aggregates -> community (community_id));
631 joinable!(community_block -> community (community_id));
632 joinable!(community_block -> person (person_id));
633 joinable!(community_follower -> community (community_id));
634 joinable!(community_follower -> person (person_id));
635 joinable!(community_moderator -> community (community_id));
636 joinable!(community_moderator -> person (person_id));
637 joinable!(community_person_ban -> community (community_id));
638 joinable!(community_person_ban -> person (person_id));
639 joinable!(local_user -> person (person_id));
640 joinable!(mod_add_community -> community (community_id));
641 joinable!(mod_transfer_community -> community (community_id));
642 joinable!(mod_ban_from_community -> community (community_id));
643 joinable!(mod_lock_post -> person (mod_person_id));
644 joinable!(mod_lock_post -> post (post_id));
645 joinable!(mod_remove_comment -> comment (comment_id));
646 joinable!(mod_remove_comment -> person (mod_person_id));
647 joinable!(mod_remove_community -> community (community_id));
648 joinable!(mod_remove_community -> person (mod_person_id));
649 joinable!(mod_remove_post -> person (mod_person_id));
650 joinable!(mod_remove_post -> post (post_id));
651 joinable!(mod_sticky_post -> person (mod_person_id));
652 joinable!(mod_sticky_post -> post (post_id));
653 joinable!(password_reset_request -> local_user (local_user_id));
654 joinable!(person_aggregates -> person (person_id));
655 joinable!(person_ban -> person (person_id));
656 joinable!(person_mention -> comment (comment_id));
657 joinable!(person_mention -> person (recipient_id));
658 joinable!(post -> community (community_id));
659 joinable!(post -> person (creator_id));
660 joinable!(post_aggregates -> post (post_id));
661 joinable!(post_like -> person (person_id));
662 joinable!(post_like -> post (post_id));
663 joinable!(post_read -> person (person_id));
664 joinable!(post_read -> post (post_id));
665 joinable!(post_report -> post (post_id));
666 joinable!(post_saved -> person (person_id));
667 joinable!(post_saved -> post (post_id));
668 joinable!(site_aggregates -> site (site_id));
669 joinable!(email_verification -> local_user (local_user_id));
670 joinable!(registration_application -> local_user (local_user_id));
671 joinable!(registration_application -> person (admin_id));
672 joinable!(mod_hide_community -> person (mod_person_id));
673 joinable!(mod_hide_community -> community (community_id));
675 allow_tables_to_appear_in_same_query!(
684 community_aggregates,
687 community_person_ban,
691 mod_transfer_community,
693 mod_ban_from_community,
696 mod_remove_community,
700 password_reset_request,
719 registration_application