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,
173 totp_2fa_secret -> Nullable<Text>,
174 totp_2fa_url -> Nullable<Text>,
181 mod_person_id -> Int4,
182 other_person_id -> Int4,
183 removed -> Nullable<Bool>,
189 mod_add_community (id) {
191 mod_person_id -> Int4,
192 other_person_id -> Int4,
193 community_id -> Int4,
194 removed -> Nullable<Bool>,
200 mod_transfer_community (id) {
202 mod_person_id -> Int4,
203 other_person_id -> Int4,
204 community_id -> Int4,
205 removed -> Nullable<Bool>,
213 mod_person_id -> Int4,
214 other_person_id -> Int4,
215 reason -> Nullable<Text>,
216 banned -> Nullable<Bool>,
217 expires -> Nullable<Timestamp>,
223 mod_ban_from_community (id) {
225 mod_person_id -> Int4,
226 other_person_id -> Int4,
227 community_id -> Int4,
228 reason -> Nullable<Text>,
229 banned -> Nullable<Bool>,
230 expires -> Nullable<Timestamp>,
238 mod_person_id -> Int4,
240 locked -> Nullable<Bool>,
246 mod_remove_comment (id) {
248 mod_person_id -> Int4,
250 reason -> Nullable<Text>,
251 removed -> Nullable<Bool>,
257 mod_remove_community (id) {
259 mod_person_id -> Int4,
260 community_id -> Int4,
261 reason -> Nullable<Text>,
262 removed -> Nullable<Bool>,
263 expires -> Nullable<Timestamp>,
269 mod_remove_post (id) {
271 mod_person_id -> Int4,
273 reason -> Nullable<Text>,
274 removed -> Nullable<Bool>,
280 mod_feature_post (id) {
282 mod_person_id -> Int4,
286 is_featured_community -> Bool,
291 password_reset_request (id) {
293 token_encrypted -> Text,
294 published -> Timestamp,
295 local_user_id -> Int4,
303 display_name -> Nullable<Varchar>,
304 avatar -> Nullable<Varchar>,
306 published -> Timestamp,
307 updated -> Nullable<Timestamp>,
309 bio -> Nullable<Text>,
311 private_key -> Nullable<Text>,
313 last_refreshed_at -> Timestamp,
314 banner -> Nullable<Varchar>,
316 inbox_url -> Varchar,
317 shared_inbox_url -> Nullable<Varchar>,
318 matrix_user_id -> Nullable<Text>,
321 ban_expires -> Nullable<Timestamp>,
327 person_aggregates (id) {
332 comment_count -> Int8,
333 comment_score -> Int8,
341 published -> Timestamp,
346 person_mention (id) {
348 recipient_id -> Int4,
351 published -> Timestamp,
358 recipient_id -> Int4,
361 published -> Timestamp,
369 url -> Nullable<Varchar>,
370 body -> Nullable<Text>,
372 community_id -> Int4,
375 published -> Timestamp,
376 updated -> Nullable<Timestamp>,
379 embed_title -> Nullable<Text>,
380 embed_description -> Nullable<Text>,
381 embed_video_url -> Nullable<Text>,
382 thumbnail_url -> Nullable<Text>,
386 featured_community -> Bool,
387 featured_local -> Bool,
392 person_post_aggregates (id) {
396 read_comments -> Int8,
397 published -> Timestamp,
402 post_aggregates (id) {
409 published -> Timestamp,
410 newest_comment_time_necro -> Timestamp,
411 newest_comment_time -> Timestamp,
412 featured_community -> Bool,
413 featured_local -> Bool,
423 published -> Timestamp,
432 published -> Timestamp,
441 original_post_name -> Varchar,
442 original_post_url -> Nullable<Text>,
443 original_post_body -> Nullable<Text>,
446 resolver_id -> Nullable<Int4>,
447 published -> Timestamp,
448 updated -> Nullable<Timestamp>,
457 published -> Timestamp,
462 private_message (id) {
465 recipient_id -> Int4,
469 published -> Timestamp,
470 updated -> Nullable<Timestamp>,
477 private_message_report (id) {
480 private_message_id -> Int4,
481 original_pm_text -> Text,
484 resolver_id -> Nullable<Int4>,
485 published -> Timestamp,
486 updated -> Nullable<Timestamp>,
494 sidebar -> Nullable<Text>,
495 published -> Timestamp,
496 updated -> Nullable<Timestamp>,
497 icon -> Nullable<Varchar>,
498 banner -> Nullable<Varchar>,
499 description -> Nullable<Text>,
501 last_refreshed_at -> Timestamp,
503 private_key -> Nullable<Text>,
510 site_aggregates (id) {
517 users_active_day -> Int8,
518 users_active_week -> Int8,
519 users_active_month -> Int8,
520 users_active_half_year -> Int8,
529 published -> Timestamp,
534 community_block (id) {
537 community_id -> Int4,
538 published -> Timestamp,
545 jwt_secret -> Varchar,
550 admin_purge_comment (id) {
552 admin_person_id -> Int4,
554 reason -> Nullable<Text>,
560 email_verification (id) {
562 local_user_id -> Int4,
564 verification_token -> Varchar,
565 published -> Timestamp,
570 admin_purge_community (id) {
572 admin_person_id -> Int4,
573 reason -> Nullable<Text>,
579 admin_purge_person (id) {
581 admin_person_id -> Int4,
582 reason -> Nullable<Text>,
588 admin_purge_post (id) {
590 admin_person_id -> Int4,
591 community_id -> Int4,
592 reason -> Nullable<Text>,
598 registration_application (id) {
600 local_user_id -> Int4,
602 admin_id -> Nullable<Int4>,
603 deny_reason -> Nullable<Text>,
604 published -> Timestamp,
609 mod_hide_community (id) {
611 community_id -> Int4,
612 mod_person_id -> Int4,
613 reason -> Nullable<Text>,
614 hidden -> Nullable<Bool>,
628 local_user_language(id) {
630 local_user_id -> Int4,
644 community_language(id) {
646 community_id -> Int4,
655 software -> Nullable<Text>,
656 version -> Nullable<Text>,
657 published -> Timestamp,
658 updated -> Nullable<Timestamp>,
663 federation_allowlist(id) {
666 published -> Timestamp,
667 updated -> Nullable<Timestamp>,
672 federation_blocklist(id) {
675 published -> Timestamp,
676 updated -> Nullable<Timestamp>,
681 use crate::source::local_site::RegistrationModeType;
682 use diesel::sql_types::*;
688 enable_downvotes -> Bool,
690 community_creation_admin_only -> Bool,
691 require_email_verification -> Bool,
692 application_question -> Nullable<Text>,
693 private_instance -> Bool,
694 default_theme -> Text,
695 default_post_listing_type -> Text,
696 legal_information -> Nullable<Text>,
697 hide_modlog_mod_names -> Bool,
698 application_email_admins -> Bool,
699 slur_filter_regex -> Nullable<Text>,
700 actor_name_max_length -> Int4,
701 federation_enabled -> Bool,
702 federation_debug -> Bool,
703 federation_worker_count -> Int4,
704 captcha_enabled -> Bool,
705 captcha_difficulty -> Text,
706 registration_mode -> RegistrationModeType,
707 reports_email_admins -> Bool,
708 published -> Timestamp,
709 updated -> Nullable<Timestamp>,
714 local_site_rate_limit(id) {
716 local_site_id -> Int4,
718 message_per_second-> Int4,
720 post_per_second -> Int4,
722 register_per_second -> Int4,
724 image_per_second -> Int4,
726 comment_per_second -> Int4,
728 search_per_second -> Int4,
729 published -> Timestamp,
730 updated -> Nullable<Timestamp>,
737 local_site_id -> Int4,
739 published -> Timestamp,
740 updated -> Nullable<Timestamp>,
745 person_follower (id) {
749 published -> Timestamp,
757 local_site_id -> Int4,
758 shortcode -> Varchar,
762 published -> Timestamp,
763 updated -> Nullable<Timestamp>,
768 custom_emoji_keyword (id) {
770 custom_emoji_id -> Int4,
775 joinable!(person_block -> person (person_id));
777 joinable!(comment -> person (creator_id));
778 joinable!(comment -> post (post_id));
779 joinable!(comment_aggregates -> comment (comment_id));
780 joinable!(comment_like -> comment (comment_id));
781 joinable!(comment_like -> person (person_id));
782 joinable!(comment_like -> post (post_id));
783 joinable!(comment_report -> comment (comment_id));
784 joinable!(comment_saved -> comment (comment_id));
785 joinable!(comment_saved -> person (person_id));
786 joinable!(community_aggregates -> community (community_id));
787 joinable!(community_block -> community (community_id));
788 joinable!(community_block -> person (person_id));
789 joinable!(community_follower -> community (community_id));
790 joinable!(community_follower -> person (person_id));
791 joinable!(community_moderator -> community (community_id));
792 joinable!(community_moderator -> person (person_id));
793 joinable!(community_person_ban -> community (community_id));
794 joinable!(community_person_ban -> person (person_id));
795 joinable!(local_user -> person (person_id));
796 joinable!(mod_add_community -> community (community_id));
797 joinable!(mod_transfer_community -> community (community_id));
798 joinable!(mod_ban_from_community -> community (community_id));
799 joinable!(mod_lock_post -> person (mod_person_id));
800 joinable!(mod_lock_post -> post (post_id));
801 joinable!(mod_remove_comment -> comment (comment_id));
802 joinable!(mod_remove_comment -> person (mod_person_id));
803 joinable!(mod_remove_community -> community (community_id));
804 joinable!(mod_remove_community -> person (mod_person_id));
805 joinable!(mod_remove_post -> person (mod_person_id));
806 joinable!(mod_remove_post -> post (post_id));
807 joinable!(mod_feature_post -> person (mod_person_id));
808 joinable!(mod_feature_post -> post (post_id));
809 joinable!(password_reset_request -> local_user (local_user_id));
810 joinable!(person_aggregates -> person (person_id));
811 joinable!(person_ban -> person (person_id));
812 joinable!(person_mention -> comment (comment_id));
813 joinable!(person_mention -> person (recipient_id));
814 joinable!(comment_reply -> comment (comment_id));
815 joinable!(comment_reply -> person (recipient_id));
816 joinable!(post -> community (community_id));
817 joinable!(post -> person (creator_id));
818 joinable!(person_post_aggregates -> post (post_id));
819 joinable!(person_post_aggregates -> person (person_id));
820 joinable!(post_aggregates -> post (post_id));
821 joinable!(post_like -> person (person_id));
822 joinable!(post_like -> post (post_id));
823 joinable!(post_read -> person (person_id));
824 joinable!(post_read -> post (post_id));
825 joinable!(post_report -> post (post_id));
826 joinable!(post_saved -> person (person_id));
827 joinable!(post_saved -> post (post_id));
828 joinable!(site_aggregates -> site (site_id));
829 joinable!(email_verification -> local_user (local_user_id));
830 joinable!(registration_application -> local_user (local_user_id));
831 joinable!(registration_application -> person (admin_id));
832 joinable!(mod_hide_community -> person (mod_person_id));
833 joinable!(mod_hide_community -> community (community_id));
834 joinable!(post -> language (language_id));
835 joinable!(comment -> language (language_id));
836 joinable!(local_user_language -> language (language_id));
837 joinable!(local_user_language -> local_user (local_user_id));
838 joinable!(private_message_report -> private_message (private_message_id));
839 joinable!(site_language -> language (language_id));
840 joinable!(site_language -> site (site_id));
841 joinable!(community_language -> language (language_id));
842 joinable!(community_language -> community (community_id));
843 joinable!(person_follower -> person (follower_id));
845 joinable!(admin_purge_comment -> person (admin_person_id));
846 joinable!(admin_purge_comment -> post (post_id));
847 joinable!(admin_purge_community -> person (admin_person_id));
848 joinable!(admin_purge_person -> person (admin_person_id));
849 joinable!(admin_purge_post -> community (community_id));
850 joinable!(admin_purge_post -> person (admin_person_id));
852 joinable!(site -> instance (instance_id));
853 joinable!(person -> instance (instance_id));
854 joinable!(community -> instance (instance_id));
855 joinable!(federation_allowlist -> instance (instance_id));
856 joinable!(federation_blocklist -> instance (instance_id));
857 joinable!(local_site -> site (site_id));
858 joinable!(local_site_rate_limit -> local_site (local_site_id));
859 joinable!(tagline -> local_site (local_site_id));
860 joinable!(custom_emoji -> local_site (local_site_id));
861 joinable!(custom_emoji_keyword -> custom_emoji (custom_emoji_id));
863 allow_tables_to_appear_in_same_query!(
872 community_aggregates,
875 community_person_ban,
879 mod_transfer_community,
881 mod_ban_from_community,
884 mod_remove_community,
888 password_reset_request,
894 person_post_aggregates,
903 private_message_report,
907 admin_purge_community,
911 registration_application,
918 federation_allowlist,
919 federation_blocklist,
921 local_site_rate_limit,
924 custom_emoji_keyword,