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,
35 comment_aggregates (id) {
41 published -> Timestamp,
53 published -> Timestamp,
62 original_comment_text -> Text,
65 resolver_id -> Nullable<Int4>,
66 published -> Timestamp,
67 updated -> Nullable<Timestamp>,
76 published -> Timestamp,
85 description -> Nullable<Text>,
87 published -> Timestamp,
88 updated -> Nullable<Timestamp>,
93 private_key -> Nullable<Text>,
95 last_refreshed_at -> Timestamp,
96 icon -> Nullable<Varchar>,
97 banner -> Nullable<Varchar>,
98 followers_url -> Varchar,
100 shared_inbox_url -> Nullable<Varchar>,
101 moderators_url -> Nullable<Varchar>,
102 featured_url -> Nullable<Varchar>,
104 posting_restricted_to_mods -> Bool,
110 community_aggregates (id) {
112 community_id -> Int4,
116 published -> Timestamp,
117 users_active_day -> Int8,
118 users_active_week -> Int8,
119 users_active_month -> Int8,
120 users_active_half_year -> Int8,
125 community_follower (id) {
127 community_id -> Int4,
129 published -> Timestamp,
135 community_moderator (id) {
137 community_id -> Int4,
139 published -> Timestamp,
144 community_person_ban (id) {
146 community_id -> Int4,
148 published -> Timestamp,
149 expires -> Nullable<Timestamp>,
157 password_encrypted -> Text,
158 email -> Nullable<Text>,
161 default_sort_type -> Int2,
162 default_listing_type -> Int2,
163 interface_language -> Varchar,
164 show_avatars -> Bool,
165 send_notifications_to_email -> Bool,
166 validator_time -> Timestamp,
167 show_bot_accounts -> Bool,
169 show_read_posts -> Bool,
170 show_new_post_notifs -> Bool,
171 email_verified -> Bool,
172 accepted_application -> Bool,
179 mod_person_id -> Int4,
180 other_person_id -> Int4,
181 removed -> Nullable<Bool>,
187 mod_add_community (id) {
189 mod_person_id -> Int4,
190 other_person_id -> Int4,
191 community_id -> Int4,
192 removed -> Nullable<Bool>,
198 mod_transfer_community (id) {
200 mod_person_id -> Int4,
201 other_person_id -> Int4,
202 community_id -> Int4,
203 removed -> Nullable<Bool>,
211 mod_person_id -> Int4,
212 other_person_id -> Int4,
213 reason -> Nullable<Text>,
214 banned -> Nullable<Bool>,
215 expires -> Nullable<Timestamp>,
221 mod_ban_from_community (id) {
223 mod_person_id -> Int4,
224 other_person_id -> Int4,
225 community_id -> Int4,
226 reason -> Nullable<Text>,
227 banned -> Nullable<Bool>,
228 expires -> Nullable<Timestamp>,
236 mod_person_id -> Int4,
238 locked -> Nullable<Bool>,
244 mod_remove_comment (id) {
246 mod_person_id -> Int4,
248 reason -> Nullable<Text>,
249 removed -> Nullable<Bool>,
255 mod_remove_community (id) {
257 mod_person_id -> Int4,
258 community_id -> Int4,
259 reason -> Nullable<Text>,
260 removed -> Nullable<Bool>,
261 expires -> Nullable<Timestamp>,
267 mod_remove_post (id) {
269 mod_person_id -> Int4,
271 reason -> Nullable<Text>,
272 removed -> Nullable<Bool>,
278 mod_feature_post (id) {
280 mod_person_id -> Int4,
284 is_featured_community -> Bool,
289 password_reset_request (id) {
291 token_encrypted -> Text,
292 published -> Timestamp,
293 local_user_id -> Int4,
301 display_name -> Nullable<Varchar>,
302 avatar -> Nullable<Varchar>,
304 published -> Timestamp,
305 updated -> Nullable<Timestamp>,
307 bio -> Nullable<Text>,
309 private_key -> Nullable<Text>,
311 last_refreshed_at -> Timestamp,
312 banner -> Nullable<Varchar>,
314 inbox_url -> Varchar,
315 shared_inbox_url -> Nullable<Varchar>,
316 matrix_user_id -> Nullable<Text>,
319 ban_expires -> Nullable<Timestamp>,
325 person_aggregates (id) {
330 comment_count -> Int8,
331 comment_score -> Int8,
339 published -> Timestamp,
344 person_mention (id) {
346 recipient_id -> Int4,
349 published -> Timestamp,
356 recipient_id -> Int4,
359 published -> Timestamp,
367 url -> Nullable<Varchar>,
368 body -> Nullable<Text>,
370 community_id -> Int4,
373 published -> Timestamp,
374 updated -> Nullable<Timestamp>,
377 embed_title -> Nullable<Text>,
378 embed_description -> Nullable<Text>,
379 embed_video_url -> Nullable<Text>,
380 thumbnail_url -> Nullable<Text>,
384 featured_community -> Bool,
385 featured_local -> Bool,
390 person_post_aggregates (id) {
394 read_comments -> Int8,
395 published -> Timestamp,
400 post_aggregates (id) {
407 published -> Timestamp,
408 newest_comment_time_necro -> Timestamp,
409 newest_comment_time -> Timestamp,
410 featured_community -> Bool,
411 featured_local -> Bool,
421 published -> Timestamp,
430 published -> Timestamp,
439 original_post_name -> Varchar,
440 original_post_url -> Nullable<Text>,
441 original_post_body -> Nullable<Text>,
444 resolver_id -> Nullable<Int4>,
445 published -> Timestamp,
446 updated -> Nullable<Timestamp>,
455 published -> Timestamp,
460 private_message (id) {
463 recipient_id -> Int4,
467 published -> Timestamp,
468 updated -> Nullable<Timestamp>,
475 private_message_report (id) {
478 private_message_id -> Int4,
479 original_pm_text -> Text,
482 resolver_id -> Nullable<Int4>,
483 published -> Timestamp,
484 updated -> Nullable<Timestamp>,
492 sidebar -> Nullable<Text>,
493 published -> Timestamp,
494 updated -> Nullable<Timestamp>,
495 icon -> Nullable<Varchar>,
496 banner -> Nullable<Varchar>,
497 description -> Nullable<Text>,
499 last_refreshed_at -> Timestamp,
501 private_key -> Nullable<Text>,
508 site_aggregates (id) {
515 users_active_day -> Int8,
516 users_active_week -> Int8,
517 users_active_month -> Int8,
518 users_active_half_year -> Int8,
527 published -> Timestamp,
532 community_block (id) {
535 community_id -> Int4,
536 published -> Timestamp,
543 jwt_secret -> Varchar,
548 admin_purge_comment (id) {
550 admin_person_id -> Int4,
552 reason -> Nullable<Text>,
558 email_verification (id) {
560 local_user_id -> Int4,
562 verification_token -> Varchar,
563 published -> Timestamp,
568 admin_purge_community (id) {
570 admin_person_id -> Int4,
571 reason -> Nullable<Text>,
577 admin_purge_person (id) {
579 admin_person_id -> Int4,
580 reason -> Nullable<Text>,
586 admin_purge_post (id) {
588 admin_person_id -> Int4,
589 community_id -> Int4,
590 reason -> Nullable<Text>,
596 registration_application (id) {
598 local_user_id -> Int4,
600 admin_id -> Nullable<Int4>,
601 deny_reason -> Nullable<Text>,
602 published -> Timestamp,
607 mod_hide_community (id) {
609 community_id -> Int4,
610 mod_person_id -> Int4,
611 reason -> Nullable<Text>,
612 hidden -> Nullable<Bool>,
626 local_user_language(id) {
628 local_user_id -> Int4,
642 community_language(id) {
644 community_id -> Int4,
653 software -> Nullable<Text>,
654 version -> Nullable<Text>,
655 published -> Timestamp,
656 updated -> Nullable<Timestamp>,
661 federation_allowlist(id) {
664 published -> Timestamp,
665 updated -> Nullable<Timestamp>,
670 federation_blocklist(id) {
673 published -> Timestamp,
674 updated -> Nullable<Timestamp>,
679 use crate::source::local_site::RegistrationModeType;
680 use diesel::sql_types::*;
686 enable_downvotes -> Bool,
688 community_creation_admin_only -> Bool,
689 require_email_verification -> Bool,
690 application_question -> Nullable<Text>,
691 private_instance -> Bool,
692 default_theme -> Text,
693 default_post_listing_type -> Text,
694 legal_information -> Nullable<Text>,
695 hide_modlog_mod_names -> Bool,
696 application_email_admins -> Bool,
697 slur_filter_regex -> Nullable<Text>,
698 actor_name_max_length -> Int4,
699 federation_enabled -> Bool,
700 federation_debug -> Bool,
701 federation_worker_count -> Int4,
702 captcha_enabled -> Bool,
703 captcha_difficulty -> Text,
704 registration_mode -> RegistrationModeType,
705 reports_email_admins -> Bool,
706 published -> Timestamp,
707 updated -> Nullable<Timestamp>,
712 local_site_rate_limit(id) {
714 local_site_id -> Int4,
716 message_per_second-> Int4,
718 post_per_second -> Int4,
720 register_per_second -> Int4,
722 image_per_second -> Int4,
724 comment_per_second -> Int4,
726 search_per_second -> Int4,
727 published -> Timestamp,
728 updated -> Nullable<Timestamp>,
735 local_site_id -> Int4,
737 published -> Timestamp,
738 updated -> Nullable<Timestamp>,
743 person_follower (id) {
747 published -> Timestamp,
752 joinable!(person_block -> person (person_id));
754 joinable!(comment -> person (creator_id));
755 joinable!(comment -> post (post_id));
756 joinable!(comment_aggregates -> comment (comment_id));
757 joinable!(comment_like -> comment (comment_id));
758 joinable!(comment_like -> person (person_id));
759 joinable!(comment_like -> post (post_id));
760 joinable!(comment_report -> comment (comment_id));
761 joinable!(comment_saved -> comment (comment_id));
762 joinable!(comment_saved -> person (person_id));
763 joinable!(community_aggregates -> community (community_id));
764 joinable!(community_block -> community (community_id));
765 joinable!(community_block -> person (person_id));
766 joinable!(community_follower -> community (community_id));
767 joinable!(community_follower -> person (person_id));
768 joinable!(community_moderator -> community (community_id));
769 joinable!(community_moderator -> person (person_id));
770 joinable!(community_person_ban -> community (community_id));
771 joinable!(community_person_ban -> person (person_id));
772 joinable!(local_user -> person (person_id));
773 joinable!(mod_add_community -> community (community_id));
774 joinable!(mod_transfer_community -> community (community_id));
775 joinable!(mod_ban_from_community -> community (community_id));
776 joinable!(mod_lock_post -> person (mod_person_id));
777 joinable!(mod_lock_post -> post (post_id));
778 joinable!(mod_remove_comment -> comment (comment_id));
779 joinable!(mod_remove_comment -> person (mod_person_id));
780 joinable!(mod_remove_community -> community (community_id));
781 joinable!(mod_remove_community -> person (mod_person_id));
782 joinable!(mod_remove_post -> person (mod_person_id));
783 joinable!(mod_remove_post -> post (post_id));
784 joinable!(mod_feature_post -> person (mod_person_id));
785 joinable!(mod_feature_post -> post (post_id));
786 joinable!(password_reset_request -> local_user (local_user_id));
787 joinable!(person_aggregates -> person (person_id));
788 joinable!(person_ban -> person (person_id));
789 joinable!(person_mention -> comment (comment_id));
790 joinable!(person_mention -> person (recipient_id));
791 joinable!(comment_reply -> comment (comment_id));
792 joinable!(comment_reply -> person (recipient_id));
793 joinable!(post -> community (community_id));
794 joinable!(post -> person (creator_id));
795 joinable!(person_post_aggregates -> post (post_id));
796 joinable!(person_post_aggregates -> person (person_id));
797 joinable!(post_aggregates -> post (post_id));
798 joinable!(post_like -> person (person_id));
799 joinable!(post_like -> post (post_id));
800 joinable!(post_read -> person (person_id));
801 joinable!(post_read -> post (post_id));
802 joinable!(post_report -> post (post_id));
803 joinable!(post_saved -> person (person_id));
804 joinable!(post_saved -> post (post_id));
805 joinable!(site_aggregates -> site (site_id));
806 joinable!(email_verification -> local_user (local_user_id));
807 joinable!(registration_application -> local_user (local_user_id));
808 joinable!(registration_application -> person (admin_id));
809 joinable!(mod_hide_community -> person (mod_person_id));
810 joinable!(mod_hide_community -> community (community_id));
811 joinable!(post -> language (language_id));
812 joinable!(comment -> language (language_id));
813 joinable!(local_user_language -> language (language_id));
814 joinable!(local_user_language -> local_user (local_user_id));
815 joinable!(private_message_report -> private_message (private_message_id));
816 joinable!(site_language -> language (language_id));
817 joinable!(site_language -> site (site_id));
818 joinable!(community_language -> language (language_id));
819 joinable!(community_language -> community (community_id));
820 joinable!(person_follower -> person (follower_id));
822 joinable!(admin_purge_comment -> person (admin_person_id));
823 joinable!(admin_purge_comment -> post (post_id));
824 joinable!(admin_purge_community -> person (admin_person_id));
825 joinable!(admin_purge_person -> person (admin_person_id));
826 joinable!(admin_purge_post -> community (community_id));
827 joinable!(admin_purge_post -> person (admin_person_id));
829 joinable!(site -> instance (instance_id));
830 joinable!(person -> instance (instance_id));
831 joinable!(community -> instance (instance_id));
832 joinable!(federation_allowlist -> instance (instance_id));
833 joinable!(federation_blocklist -> instance (instance_id));
834 joinable!(local_site -> site (site_id));
835 joinable!(local_site_rate_limit -> local_site (local_site_id));
836 joinable!(tagline -> local_site (local_site_id));
838 allow_tables_to_appear_in_same_query!(
847 community_aggregates,
850 community_person_ban,
854 mod_transfer_community,
856 mod_ban_from_community,
859 mod_remove_community,
863 password_reset_request,
869 person_post_aggregates,
878 private_message_report,
882 admin_purge_community,
886 registration_application,
893 federation_allowlist,
894 federation_blocklist,
896 local_site_rate_limit,