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>,
467 site_aggregates (id) {
474 users_active_day -> Int8,
475 users_active_week -> Int8,
476 users_active_month -> Int8,
477 users_active_half_year -> Int8,
486 published -> Timestamp,
491 community_block (id) {
494 community_id -> Int4,
495 published -> Timestamp,
499 // These are necessary since diesel doesn't have self joins / aliases
501 comment_alias_1 (id) {
505 parent_id -> Nullable<Int4>,
509 published -> Timestamp,
510 updated -> Nullable<Timestamp>,
518 person_alias_1 (id) {
521 display_name -> Nullable<Varchar>,
522 avatar -> Nullable<Varchar>,
524 published -> Timestamp,
525 updated -> Nullable<Timestamp>,
527 bio -> Nullable<Text>,
529 private_key -> Nullable<Text>,
531 last_refreshed_at -> Timestamp,
532 banner -> Nullable<Varchar>,
534 inbox_url -> Varchar,
535 shared_inbox_url -> Nullable<Varchar>,
536 matrix_user_id -> Nullable<Text>,
539 ban_expires -> Nullable<Timestamp>,
544 person_alias_2 (id) {
547 display_name -> Nullable<Varchar>,
548 avatar -> Nullable<Varchar>,
550 published -> Timestamp,
551 updated -> Nullable<Timestamp>,
553 bio -> Nullable<Text>,
555 private_key -> Nullable<Text>,
557 last_refreshed_at -> Timestamp,
558 banner -> Nullable<Varchar>,
560 inbox_url -> Varchar,
561 shared_inbox_url -> Nullable<Varchar>,
562 matrix_user_id -> Nullable<Text>,
565 ban_expires -> Nullable<Timestamp>,
572 jwt_secret -> Varchar,
577 email_verification (id) {
579 local_user_id -> Int4,
581 verification_token -> Varchar,
582 published -> Timestamp,
587 registration_application (id) {
589 local_user_id -> Int4,
591 admin_id -> Nullable<Int4>,
592 deny_reason -> Nullable<Text>,
593 published -> Timestamp,
598 mod_hide_community (id) {
600 community_id -> Int4,
601 mod_person_id -> Int4,
602 reason -> Nullable<Text>,
603 hidden -> Nullable<Bool>,
608 joinable!(comment_alias_1 -> person_alias_1 (creator_id));
609 joinable!(comment -> comment_alias_1 (parent_id));
610 joinable!(person_mention -> person_alias_1 (recipient_id));
611 joinable!(post -> person_alias_1 (creator_id));
612 joinable!(comment -> person_alias_1 (creator_id));
614 joinable!(post_report -> person_alias_2 (resolver_id));
615 joinable!(comment_report -> person_alias_2 (resolver_id));
617 joinable!(person_block -> person (person_id));
618 joinable!(person_block -> person_alias_1 (target_id));
620 joinable!(comment -> person (creator_id));
621 joinable!(comment -> post (post_id));
622 joinable!(comment_aggregates -> comment (comment_id));
623 joinable!(comment_like -> comment (comment_id));
624 joinable!(comment_like -> person (person_id));
625 joinable!(comment_like -> post (post_id));
626 joinable!(comment_report -> comment (comment_id));
627 joinable!(comment_saved -> comment (comment_id));
628 joinable!(comment_saved -> person (person_id));
629 joinable!(community_aggregates -> community (community_id));
630 joinable!(community_block -> community (community_id));
631 joinable!(community_block -> person (person_id));
632 joinable!(community_follower -> community (community_id));
633 joinable!(community_follower -> person (person_id));
634 joinable!(community_moderator -> community (community_id));
635 joinable!(community_moderator -> person (person_id));
636 joinable!(community_person_ban -> community (community_id));
637 joinable!(community_person_ban -> person (person_id));
638 joinable!(local_user -> person (person_id));
639 joinable!(mod_add_community -> community (community_id));
640 joinable!(mod_transfer_community -> community (community_id));
641 joinable!(mod_ban_from_community -> community (community_id));
642 joinable!(mod_lock_post -> person (mod_person_id));
643 joinable!(mod_lock_post -> post (post_id));
644 joinable!(mod_remove_comment -> comment (comment_id));
645 joinable!(mod_remove_comment -> person (mod_person_id));
646 joinable!(mod_remove_community -> community (community_id));
647 joinable!(mod_remove_community -> person (mod_person_id));
648 joinable!(mod_remove_post -> person (mod_person_id));
649 joinable!(mod_remove_post -> post (post_id));
650 joinable!(mod_sticky_post -> person (mod_person_id));
651 joinable!(mod_sticky_post -> post (post_id));
652 joinable!(password_reset_request -> local_user (local_user_id));
653 joinable!(person_aggregates -> person (person_id));
654 joinable!(person_ban -> person (person_id));
655 joinable!(person_mention -> comment (comment_id));
656 joinable!(person_mention -> person (recipient_id));
657 joinable!(post -> community (community_id));
658 joinable!(post -> person (creator_id));
659 joinable!(post_aggregates -> post (post_id));
660 joinable!(post_like -> person (person_id));
661 joinable!(post_like -> post (post_id));
662 joinable!(post_read -> person (person_id));
663 joinable!(post_read -> post (post_id));
664 joinable!(post_report -> post (post_id));
665 joinable!(post_saved -> person (person_id));
666 joinable!(post_saved -> post (post_id));
667 joinable!(site_aggregates -> site (site_id));
668 joinable!(email_verification -> local_user (local_user_id));
669 joinable!(registration_application -> local_user (local_user_id));
670 joinable!(registration_application -> person (admin_id));
671 joinable!(mod_hide_community -> person (mod_person_id));
672 joinable!(mod_hide_community -> community (community_id));
674 allow_tables_to_appear_in_same_query!(
683 community_aggregates,
686 community_person_ban,
690 mod_transfer_community,
692 mod_ban_from_community,
695 mod_remove_community,
699 password_reset_request,
718 registration_application