1 // @generated automatically by Diesel CLI.
4 #[derive(diesel::sql_types::SqlType)]
5 #[diesel(postgres_type(name = "listing_type_enum"))]
6 pub struct ListingTypeEnum;
8 #[derive(diesel::sql_types::SqlType)]
9 #[diesel(postgres_type(name = "registration_mode_enum"))]
10 pub struct RegistrationModeEnum;
12 #[derive(diesel::sql_types::SqlType)]
13 #[diesel(postgres_type(name = "sort_type_enum"))]
14 pub struct SortTypeEnum;
18 admin_purge_comment (id) {
20 admin_person_id -> Int4,
22 reason -> Nullable<Text>,
28 admin_purge_community (id) {
30 admin_person_id -> Int4,
31 reason -> Nullable<Text>,
37 admin_purge_person (id) {
39 admin_person_id -> Int4,
40 reason -> Nullable<Text>,
46 admin_purge_post (id) {
48 admin_person_id -> Int4,
50 reason -> Nullable<Text>,
60 published -> Timestamp,
65 use diesel::sql_types::*;
66 use diesel_ltree::sql_types::Ltree;
74 published -> Timestamp,
75 updated -> Nullable<Timestamp>,
81 distinguished -> Bool,
87 comment_aggregates (id) {
93 published -> Timestamp,
106 published -> Timestamp,
113 recipient_id -> Int4,
116 published -> Timestamp,
121 comment_report (id) {
125 original_comment_text -> Text,
128 resolver_id -> Nullable<Int4>,
129 published -> Timestamp,
130 updated -> Nullable<Timestamp>,
139 published -> Timestamp,
150 description -> Nullable<Text>,
152 published -> Timestamp,
153 updated -> Nullable<Timestamp>,
159 private_key -> Nullable<Text>,
161 last_refreshed_at -> Timestamp,
162 icon -> Nullable<Text>,
163 banner -> Nullable<Text>,
165 followers_url -> Varchar,
167 inbox_url -> Varchar,
169 shared_inbox_url -> Nullable<Varchar>,
171 posting_restricted_to_mods -> Bool,
174 moderators_url -> Nullable<Varchar>,
176 featured_url -> Nullable<Varchar>,
181 community_aggregates (id) {
183 community_id -> Int4,
187 published -> Timestamp,
188 users_active_day -> Int8,
189 users_active_week -> Int8,
190 users_active_month -> Int8,
191 users_active_half_year -> Int8,
197 community_block (id) {
200 community_id -> Int4,
201 published -> Timestamp,
206 community_follower (id) {
208 community_id -> Int4,
210 published -> Timestamp,
216 community_language (id) {
218 community_id -> Int4,
224 community_moderator (id) {
226 community_id -> Int4,
228 published -> Timestamp,
233 community_person_ban (id) {
235 community_id -> Int4,
237 published -> Timestamp,
238 expires -> Nullable<Timestamp>,
245 local_site_id -> Int4,
247 shortcode -> Varchar,
251 published -> Timestamp,
252 updated -> Nullable<Timestamp>,
257 custom_emoji_keyword (id) {
259 custom_emoji_id -> Int4,
266 email_verification (id) {
268 local_user_id -> Int4,
270 verification_token -> Text,
271 published -> Timestamp,
276 federation_allowlist (id) {
279 published -> Timestamp,
280 updated -> Nullable<Timestamp>,
285 federation_blocklist (id) {
288 published -> Timestamp,
289 updated -> Nullable<Timestamp>,
298 published -> Timestamp,
299 updated -> Nullable<Timestamp>,
301 software -> Nullable<Varchar>,
303 version -> Nullable<Varchar>,
317 use diesel::sql_types::*;
318 use super::sql_types::ListingTypeEnum;
319 use super::sql_types::RegistrationModeEnum;
325 enable_downvotes -> Bool,
327 community_creation_admin_only -> Bool,
328 require_email_verification -> Bool,
329 application_question -> Nullable<Text>,
330 private_instance -> Bool,
331 default_theme -> Text,
332 default_post_listing_type -> ListingTypeEnum,
333 legal_information -> Nullable<Text>,
334 hide_modlog_mod_names -> Bool,
335 application_email_admins -> Bool,
336 slur_filter_regex -> Nullable<Text>,
337 actor_name_max_length -> Int4,
338 federation_enabled -> Bool,
339 captcha_enabled -> Bool,
341 captcha_difficulty -> Varchar,
342 published -> Timestamp,
343 updated -> Nullable<Timestamp>,
344 registration_mode -> RegistrationModeEnum,
345 reports_email_admins -> Bool,
350 local_site_rate_limit (id) {
352 local_site_id -> Int4,
354 message_per_second -> Int4,
356 post_per_second -> Int4,
358 register_per_second -> Int4,
360 image_per_second -> Int4,
362 comment_per_second -> Int4,
364 search_per_second -> Int4,
365 published -> Timestamp,
366 updated -> Nullable<Timestamp>,
371 use diesel::sql_types::*;
372 use super::sql_types::SortTypeEnum;
373 use super::sql_types::ListingTypeEnum;
378 password_encrypted -> Text,
379 email -> Nullable<Text>,
382 default_sort_type -> SortTypeEnum,
383 default_listing_type -> ListingTypeEnum,
385 interface_language -> Varchar,
386 show_avatars -> Bool,
387 send_notifications_to_email -> Bool,
388 validator_time -> Timestamp,
390 show_bot_accounts -> Bool,
391 show_read_posts -> Bool,
392 show_new_post_notifs -> Bool,
393 email_verified -> Bool,
394 accepted_application -> Bool,
395 totp_2fa_secret -> Nullable<Text>,
396 totp_2fa_url -> Nullable<Text>,
397 open_links_in_new_tab -> Bool,
400 infinite_scroll_enabled -> Bool,
405 local_user_language (id) {
407 local_user_id -> Int4,
415 mod_person_id -> Int4,
416 other_person_id -> Int4,
423 mod_add_community (id) {
425 mod_person_id -> Int4,
426 other_person_id -> Int4,
427 community_id -> Int4,
436 mod_person_id -> Int4,
437 other_person_id -> Int4,
438 reason -> Nullable<Text>,
440 expires -> Nullable<Timestamp>,
446 mod_ban_from_community (id) {
448 mod_person_id -> Int4,
449 other_person_id -> Int4,
450 community_id -> Int4,
451 reason -> Nullable<Text>,
453 expires -> Nullable<Timestamp>,
459 mod_feature_post (id) {
461 mod_person_id -> Int4,
465 is_featured_community -> Bool,
470 mod_hide_community (id) {
472 community_id -> Int4,
473 mod_person_id -> Int4,
475 reason -> Nullable<Text>,
483 mod_person_id -> Int4,
491 mod_remove_comment (id) {
493 mod_person_id -> Int4,
495 reason -> Nullable<Text>,
502 mod_remove_community (id) {
504 mod_person_id -> Int4,
505 community_id -> Int4,
506 reason -> Nullable<Text>,
508 expires -> Nullable<Timestamp>,
514 mod_remove_post (id) {
516 mod_person_id -> Int4,
518 reason -> Nullable<Text>,
525 mod_transfer_community (id) {
527 mod_person_id -> Int4,
528 other_person_id -> Int4,
529 community_id -> Int4,
535 password_reset_request (id) {
537 token_encrypted -> Text,
538 published -> Timestamp,
539 local_user_id -> Int4,
549 display_name -> Nullable<Varchar>,
550 avatar -> Nullable<Text>,
552 published -> Timestamp,
553 updated -> Nullable<Timestamp>,
556 bio -> Nullable<Text>,
558 private_key -> Nullable<Text>,
560 last_refreshed_at -> Timestamp,
561 banner -> Nullable<Text>,
564 inbox_url -> Varchar,
566 shared_inbox_url -> Nullable<Varchar>,
567 matrix_user_id -> Nullable<Text>,
570 ban_expires -> Nullable<Timestamp>,
576 person_aggregates (id) {
581 comment_count -> Int8,
582 comment_score -> Int8,
590 published -> Timestamp,
599 published -> Timestamp,
604 person_follower (id) {
608 published -> Timestamp,
614 person_mention (id) {
616 recipient_id -> Int4,
619 published -> Timestamp,
624 person_post_aggregates (id) {
628 read_comments -> Int8,
629 published -> Timestamp,
639 url -> Nullable<Varchar>,
640 body -> Nullable<Text>,
642 community_id -> Int4,
645 published -> Timestamp,
646 updated -> Nullable<Timestamp>,
649 embed_title -> Nullable<Text>,
650 embed_description -> Nullable<Text>,
651 thumbnail_url -> Nullable<Text>,
655 embed_video_url -> Nullable<Text>,
657 featured_community -> Bool,
658 featured_local -> Bool,
663 post_aggregates (id) {
670 published -> Timestamp,
671 newest_comment_time_necro -> Timestamp,
672 newest_comment_time -> Timestamp,
673 featured_community -> Bool,
674 featured_local -> Bool,
676 hot_rank_active -> Int4,
677 community_id -> Int4,
688 published -> Timestamp,
697 published -> Timestamp,
707 original_post_name -> Varchar,
708 original_post_url -> Nullable<Text>,
709 original_post_body -> Nullable<Text>,
712 resolver_id -> Nullable<Int4>,
713 published -> Timestamp,
714 updated -> Nullable<Timestamp>,
723 published -> Timestamp,
728 private_message (id) {
731 recipient_id -> Int4,
735 published -> Timestamp,
736 updated -> Nullable<Timestamp>,
744 private_message_report (id) {
747 private_message_id -> Int4,
748 original_pm_text -> Text,
751 resolver_id -> Nullable<Int4>,
752 published -> Timestamp,
753 updated -> Nullable<Timestamp>,
758 received_activity (id) {
761 published -> Timestamp,
766 registration_application (id) {
768 local_user_id -> Int4,
770 admin_id -> Nullable<Int4>,
771 deny_reason -> Nullable<Text>,
772 published -> Timestamp,
779 jwt_secret -> Varchar,
789 published -> Timestamp,
798 sidebar -> Nullable<Text>,
799 published -> Timestamp,
800 updated -> Nullable<Timestamp>,
801 icon -> Nullable<Text>,
802 banner -> Nullable<Text>,
804 description -> Nullable<Varchar>,
807 last_refreshed_at -> Timestamp,
809 inbox_url -> Varchar,
810 private_key -> Nullable<Text>,
817 site_aggregates (id) {
824 users_active_day -> Int8,
825 users_active_week -> Int8,
826 users_active_month -> Int8,
827 users_active_half_year -> Int8,
842 local_site_id -> Int4,
844 published -> Timestamp,
845 updated -> Nullable<Timestamp>,
849 diesel::joinable!(admin_purge_comment -> person (admin_person_id));
850 diesel::joinable!(admin_purge_comment -> post (post_id));
851 diesel::joinable!(admin_purge_community -> person (admin_person_id));
852 diesel::joinable!(admin_purge_person -> person (admin_person_id));
853 diesel::joinable!(admin_purge_post -> community (community_id));
854 diesel::joinable!(admin_purge_post -> person (admin_person_id));
855 diesel::joinable!(comment -> language (language_id));
856 diesel::joinable!(comment -> person (creator_id));
857 diesel::joinable!(comment -> post (post_id));
858 diesel::joinable!(comment_aggregates -> comment (comment_id));
859 diesel::joinable!(comment_like -> comment (comment_id));
860 diesel::joinable!(comment_like -> person (person_id));
861 diesel::joinable!(comment_like -> post (post_id));
862 diesel::joinable!(comment_reply -> comment (comment_id));
863 diesel::joinable!(comment_reply -> person (recipient_id));
864 diesel::joinable!(comment_report -> comment (comment_id));
865 diesel::joinable!(comment_saved -> comment (comment_id));
866 diesel::joinable!(comment_saved -> person (person_id));
867 diesel::joinable!(community -> instance (instance_id));
868 diesel::joinable!(community_aggregates -> community (community_id));
869 diesel::joinable!(community_block -> community (community_id));
870 diesel::joinable!(community_block -> person (person_id));
871 diesel::joinable!(community_follower -> community (community_id));
872 diesel::joinable!(community_follower -> person (person_id));
873 diesel::joinable!(community_language -> community (community_id));
874 diesel::joinable!(community_language -> language (language_id));
875 diesel::joinable!(community_moderator -> community (community_id));
876 diesel::joinable!(community_moderator -> person (person_id));
877 diesel::joinable!(community_person_ban -> community (community_id));
878 diesel::joinable!(community_person_ban -> person (person_id));
879 diesel::joinable!(custom_emoji -> local_site (local_site_id));
880 diesel::joinable!(custom_emoji_keyword -> custom_emoji (custom_emoji_id));
881 diesel::joinable!(email_verification -> local_user (local_user_id));
882 diesel::joinable!(federation_allowlist -> instance (instance_id));
883 diesel::joinable!(federation_blocklist -> instance (instance_id));
884 diesel::joinable!(local_site -> site (site_id));
885 diesel::joinable!(local_site_rate_limit -> local_site (local_site_id));
886 diesel::joinable!(local_user -> person (person_id));
887 diesel::joinable!(local_user_language -> language (language_id));
888 diesel::joinable!(local_user_language -> local_user (local_user_id));
889 diesel::joinable!(mod_add_community -> community (community_id));
890 diesel::joinable!(mod_ban_from_community -> community (community_id));
891 diesel::joinable!(mod_feature_post -> person (mod_person_id));
892 diesel::joinable!(mod_feature_post -> post (post_id));
893 diesel::joinable!(mod_hide_community -> community (community_id));
894 diesel::joinable!(mod_hide_community -> person (mod_person_id));
895 diesel::joinable!(mod_lock_post -> person (mod_person_id));
896 diesel::joinable!(mod_lock_post -> post (post_id));
897 diesel::joinable!(mod_remove_comment -> comment (comment_id));
898 diesel::joinable!(mod_remove_comment -> person (mod_person_id));
899 diesel::joinable!(mod_remove_community -> community (community_id));
900 diesel::joinable!(mod_remove_community -> person (mod_person_id));
901 diesel::joinable!(mod_remove_post -> person (mod_person_id));
902 diesel::joinable!(mod_remove_post -> post (post_id));
903 diesel::joinable!(mod_transfer_community -> community (community_id));
904 diesel::joinable!(password_reset_request -> local_user (local_user_id));
905 diesel::joinable!(person -> instance (instance_id));
906 diesel::joinable!(person_aggregates -> person (person_id));
907 diesel::joinable!(person_ban -> person (person_id));
908 diesel::joinable!(person_mention -> comment (comment_id));
909 diesel::joinable!(person_mention -> person (recipient_id));
910 diesel::joinable!(person_post_aggregates -> person (person_id));
911 diesel::joinable!(person_post_aggregates -> post (post_id));
912 diesel::joinable!(post -> community (community_id));
913 diesel::joinable!(post -> language (language_id));
914 diesel::joinable!(post -> person (creator_id));
915 diesel::joinable!(post_aggregates -> community (community_id));
916 diesel::joinable!(post_aggregates -> person (creator_id));
917 diesel::joinable!(post_aggregates -> post (post_id));
918 diesel::joinable!(post_like -> person (person_id));
919 diesel::joinable!(post_like -> post (post_id));
920 diesel::joinable!(post_read -> person (person_id));
921 diesel::joinable!(post_read -> post (post_id));
922 diesel::joinable!(post_report -> post (post_id));
923 diesel::joinable!(post_saved -> person (person_id));
924 diesel::joinable!(post_saved -> post (post_id));
925 diesel::joinable!(private_message_report -> private_message (private_message_id));
926 diesel::joinable!(registration_application -> local_user (local_user_id));
927 diesel::joinable!(registration_application -> person (admin_id));
928 diesel::joinable!(site -> instance (instance_id));
929 diesel::joinable!(site_aggregates -> site (site_id));
930 diesel::joinable!(site_language -> language (language_id));
931 diesel::joinable!(site_language -> site (site_id));
932 diesel::joinable!(tagline -> local_site (local_site_id));
934 diesel::allow_tables_to_appear_in_same_query!(
936 admin_purge_community,
947 community_aggregates,
952 community_person_ban,
954 custom_emoji_keyword,
956 federation_allowlist,
957 federation_blocklist,
961 local_site_rate_limit,
967 mod_ban_from_community,
972 mod_remove_community,
974 mod_transfer_community,
975 password_reset_request,
982 person_post_aggregates,
990 private_message_report,
992 registration_application,