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>,
29 distinguished -> Bool,
34 comment_aggregates (id) {
40 published -> Timestamp,
52 published -> Timestamp,
61 original_comment_text -> Text,
64 resolver_id -> Nullable<Int4>,
65 published -> Timestamp,
66 updated -> Nullable<Timestamp>,
75 published -> Timestamp,
84 description -> Nullable<Text>,
86 published -> Timestamp,
87 updated -> Nullable<Timestamp>,
92 private_key -> Nullable<Text>,
94 last_refreshed_at -> Timestamp,
95 icon -> Nullable<Varchar>,
96 banner -> Nullable<Varchar>,
97 followers_url -> Varchar,
99 shared_inbox_url -> Nullable<Varchar>,
101 posting_restricted_to_mods -> Bool,
106 community_aggregates (id) {
108 community_id -> Int4,
112 published -> Timestamp,
113 users_active_day -> Int8,
114 users_active_week -> Int8,
115 users_active_month -> Int8,
116 users_active_half_year -> Int8,
121 community_follower (id) {
123 community_id -> Int4,
125 published -> Timestamp,
126 pending -> Nullable<Bool>,
131 community_moderator (id) {
133 community_id -> Int4,
135 published -> Timestamp,
140 community_person_ban (id) {
142 community_id -> Int4,
144 published -> Timestamp,
145 expires -> Nullable<Timestamp>,
153 password_encrypted -> Text,
154 email -> Nullable<Text>,
157 default_sort_type -> Int2,
158 default_listing_type -> Int2,
160 show_avatars -> Bool,
161 send_notifications_to_email -> Bool,
162 validator_time -> Timestamp,
163 show_bot_accounts -> Bool,
165 show_read_posts -> Bool,
166 show_new_post_notifs -> Bool,
167 email_verified -> Bool,
168 accepted_application -> Bool,
175 mod_person_id -> Int4,
176 other_person_id -> Int4,
177 removed -> Nullable<Bool>,
183 mod_add_community (id) {
185 mod_person_id -> Int4,
186 other_person_id -> Int4,
187 community_id -> Int4,
188 removed -> Nullable<Bool>,
194 mod_transfer_community (id) {
196 mod_person_id -> Int4,
197 other_person_id -> Int4,
198 community_id -> Int4,
199 removed -> Nullable<Bool>,
207 mod_person_id -> Int4,
208 other_person_id -> Int4,
209 reason -> Nullable<Text>,
210 banned -> Nullable<Bool>,
211 expires -> Nullable<Timestamp>,
217 mod_ban_from_community (id) {
219 mod_person_id -> Int4,
220 other_person_id -> Int4,
221 community_id -> Int4,
222 reason -> Nullable<Text>,
223 banned -> Nullable<Bool>,
224 expires -> Nullable<Timestamp>,
232 mod_person_id -> Int4,
234 locked -> Nullable<Bool>,
240 mod_remove_comment (id) {
242 mod_person_id -> Int4,
244 reason -> Nullable<Text>,
245 removed -> Nullable<Bool>,
251 mod_remove_community (id) {
253 mod_person_id -> Int4,
254 community_id -> Int4,
255 reason -> Nullable<Text>,
256 removed -> Nullable<Bool>,
257 expires -> Nullable<Timestamp>,
263 mod_remove_post (id) {
265 mod_person_id -> Int4,
267 reason -> Nullable<Text>,
268 removed -> Nullable<Bool>,
274 mod_sticky_post (id) {
276 mod_person_id -> Int4,
278 stickied -> Nullable<Bool>,
284 password_reset_request (id) {
286 token_encrypted -> Text,
287 published -> Timestamp,
288 local_user_id -> Int4,
296 display_name -> Nullable<Varchar>,
297 avatar -> Nullable<Varchar>,
299 published -> Timestamp,
300 updated -> Nullable<Timestamp>,
302 bio -> Nullable<Text>,
304 private_key -> Nullable<Text>,
306 last_refreshed_at -> Timestamp,
307 banner -> Nullable<Varchar>,
309 inbox_url -> Varchar,
310 shared_inbox_url -> Nullable<Varchar>,
311 matrix_user_id -> Nullable<Text>,
314 ban_expires -> Nullable<Timestamp>,
319 person_aggregates (id) {
324 comment_count -> Int8,
325 comment_score -> Int8,
333 published -> Timestamp,
338 person_mention (id) {
340 recipient_id -> Int4,
343 published -> Timestamp,
350 recipient_id -> Int4,
353 published -> Timestamp,
361 url -> Nullable<Varchar>,
362 body -> Nullable<Text>,
364 community_id -> Int4,
367 published -> Timestamp,
368 updated -> Nullable<Timestamp>,
372 embed_title -> Nullable<Text>,
373 embed_description -> Nullable<Text>,
374 embed_video_url -> Nullable<Text>,
375 thumbnail_url -> Nullable<Text>,
382 post_aggregates (id) {
390 published -> Timestamp,
391 newest_comment_time_necro -> Timestamp,
392 newest_comment_time -> Timestamp,
402 published -> Timestamp,
411 published -> Timestamp,
420 original_post_name -> Varchar,
421 original_post_url -> Nullable<Text>,
422 original_post_body -> Nullable<Text>,
425 resolver_id -> Nullable<Int4>,
426 published -> Timestamp,
427 updated -> Nullable<Timestamp>,
436 published -> Timestamp,
441 private_message (id) {
444 recipient_id -> Int4,
448 published -> Timestamp,
449 updated -> Nullable<Timestamp>,
459 sidebar -> Nullable<Text>,
460 published -> Timestamp,
461 updated -> Nullable<Timestamp>,
462 enable_downvotes -> Bool,
463 open_registration -> Bool,
465 icon -> Nullable<Varchar>,
466 banner -> Nullable<Varchar>,
467 description -> Nullable<Text>,
468 community_creation_admin_only -> Bool,
469 require_email_verification -> Bool,
470 require_application -> Bool,
471 application_question -> Nullable<Text>,
472 private_instance -> Bool,
474 last_refreshed_at -> Timestamp,
476 private_key -> Nullable<Text>,
478 default_theme -> Text,
479 default_post_listing_type -> Text,
480 legal_information -> Nullable<Text>,
481 hide_modlog_mod_names -> Bool,
486 site_aggregates (id) {
493 users_active_day -> Int8,
494 users_active_week -> Int8,
495 users_active_month -> Int8,
496 users_active_half_year -> Int8,
505 published -> Timestamp,
510 community_block (id) {
513 community_id -> Int4,
514 published -> Timestamp,
518 // These are necessary since diesel doesn't have self joins / aliases
520 person_alias_1 (id) {
523 display_name -> Nullable<Varchar>,
524 avatar -> Nullable<Varchar>,
526 published -> Timestamp,
527 updated -> Nullable<Timestamp>,
529 bio -> Nullable<Text>,
531 private_key -> Nullable<Text>,
533 last_refreshed_at -> Timestamp,
534 banner -> Nullable<Varchar>,
536 inbox_url -> Varchar,
537 shared_inbox_url -> Nullable<Varchar>,
538 matrix_user_id -> Nullable<Text>,
541 ban_expires -> Nullable<Timestamp>,
546 person_alias_2 (id) {
549 display_name -> Nullable<Varchar>,
550 avatar -> Nullable<Varchar>,
552 published -> Timestamp,
553 updated -> Nullable<Timestamp>,
555 bio -> Nullable<Text>,
557 private_key -> Nullable<Text>,
559 last_refreshed_at -> Timestamp,
560 banner -> Nullable<Varchar>,
562 inbox_url -> Varchar,
563 shared_inbox_url -> Nullable<Varchar>,
564 matrix_user_id -> Nullable<Text>,
567 ban_expires -> Nullable<Timestamp>,
574 jwt_secret -> Varchar,
579 admin_purge_comment (id) {
581 admin_person_id -> Int4,
583 reason -> Nullable<Text>,
589 email_verification (id) {
591 local_user_id -> Int4,
593 verification_token -> Varchar,
594 published -> Timestamp,
599 admin_purge_community (id) {
601 admin_person_id -> Int4,
602 reason -> Nullable<Text>,
608 admin_purge_person (id) {
610 admin_person_id -> Int4,
611 reason -> Nullable<Text>,
617 admin_purge_post (id) {
619 admin_person_id -> Int4,
620 community_id -> Int4,
621 reason -> Nullable<Text>,
627 registration_application (id) {
629 local_user_id -> Int4,
631 admin_id -> Nullable<Int4>,
632 deny_reason -> Nullable<Text>,
633 published -> Timestamp,
638 mod_hide_community (id) {
640 community_id -> Int4,
641 mod_person_id -> Int4,
642 reason -> Nullable<Text>,
643 hidden -> Nullable<Bool>,
648 joinable!(person_mention -> person_alias_1 (recipient_id));
649 joinable!(comment_reply -> person_alias_1 (recipient_id));
650 joinable!(post -> person_alias_1 (creator_id));
651 joinable!(comment -> person_alias_1 (creator_id));
653 joinable!(post_report -> person_alias_2 (resolver_id));
654 joinable!(comment_report -> person_alias_2 (resolver_id));
656 joinable!(person_block -> person (person_id));
657 joinable!(person_block -> person_alias_1 (target_id));
659 joinable!(comment -> person (creator_id));
660 joinable!(comment -> post (post_id));
661 joinable!(comment_aggregates -> comment (comment_id));
662 joinable!(comment_like -> comment (comment_id));
663 joinable!(comment_like -> person (person_id));
664 joinable!(comment_like -> post (post_id));
665 joinable!(comment_report -> comment (comment_id));
666 joinable!(comment_saved -> comment (comment_id));
667 joinable!(comment_saved -> person (person_id));
668 joinable!(community_aggregates -> community (community_id));
669 joinable!(community_block -> community (community_id));
670 joinable!(community_block -> person (person_id));
671 joinable!(community_follower -> community (community_id));
672 joinable!(community_follower -> person (person_id));
673 joinable!(community_moderator -> community (community_id));
674 joinable!(community_moderator -> person (person_id));
675 joinable!(community_person_ban -> community (community_id));
676 joinable!(community_person_ban -> person (person_id));
677 joinable!(local_user -> person (person_id));
678 joinable!(mod_add_community -> community (community_id));
679 joinable!(mod_transfer_community -> community (community_id));
680 joinable!(mod_ban_from_community -> community (community_id));
681 joinable!(mod_lock_post -> person (mod_person_id));
682 joinable!(mod_lock_post -> post (post_id));
683 joinable!(mod_remove_comment -> comment (comment_id));
684 joinable!(mod_remove_comment -> person (mod_person_id));
685 joinable!(mod_remove_community -> community (community_id));
686 joinable!(mod_remove_community -> person (mod_person_id));
687 joinable!(mod_remove_post -> person (mod_person_id));
688 joinable!(mod_remove_post -> post (post_id));
689 joinable!(mod_sticky_post -> person (mod_person_id));
690 joinable!(mod_sticky_post -> post (post_id));
691 joinable!(password_reset_request -> local_user (local_user_id));
692 joinable!(person_aggregates -> person (person_id));
693 joinable!(person_ban -> person (person_id));
694 joinable!(person_mention -> comment (comment_id));
695 joinable!(person_mention -> person (recipient_id));
696 joinable!(comment_reply -> comment (comment_id));
697 joinable!(comment_reply -> person (recipient_id));
698 joinable!(post -> community (community_id));
699 joinable!(post -> person (creator_id));
700 joinable!(post_aggregates -> post (post_id));
701 joinable!(post_like -> person (person_id));
702 joinable!(post_like -> post (post_id));
703 joinable!(post_read -> person (person_id));
704 joinable!(post_read -> post (post_id));
705 joinable!(post_report -> post (post_id));
706 joinable!(post_saved -> person (person_id));
707 joinable!(post_saved -> post (post_id));
708 joinable!(site_aggregates -> site (site_id));
709 joinable!(email_verification -> local_user (local_user_id));
710 joinable!(registration_application -> local_user (local_user_id));
711 joinable!(registration_application -> person (admin_id));
712 joinable!(mod_hide_community -> person (mod_person_id));
713 joinable!(mod_hide_community -> community (community_id));
715 joinable!(admin_purge_comment -> person (admin_person_id));
716 joinable!(admin_purge_comment -> post (post_id));
717 joinable!(admin_purge_community -> person (admin_person_id));
718 joinable!(admin_purge_person -> person (admin_person_id));
719 joinable!(admin_purge_post -> community (community_id));
720 joinable!(admin_purge_post -> person (admin_person_id));
722 allow_tables_to_appear_in_same_query!(
731 community_aggregates,
734 community_person_ban,
738 mod_transfer_community,
740 mod_ban_from_community,
743 mod_remove_community,
747 password_reset_request,
766 admin_purge_community,
770 registration_application