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;
22 published -> Timestamp,
23 updated -> Nullable<Timestamp>,
30 admin_purge_comment (id) {
32 admin_person_id -> Int4,
34 reason -> Nullable<Text>,
40 admin_purge_community (id) {
42 admin_person_id -> Int4,
43 reason -> Nullable<Text>,
49 admin_purge_person (id) {
51 admin_person_id -> Int4,
52 reason -> Nullable<Text>,
58 admin_purge_post (id) {
60 admin_person_id -> Int4,
62 reason -> Nullable<Text>,
68 use diesel::sql_types::{Bool, Int4, Nullable, Text, Timestamp, Varchar};
69 use diesel_ltree::sql_types::Ltree;
77 published -> Timestamp,
78 updated -> Nullable<Timestamp>,
84 distinguished -> Bool,
90 comment_aggregates (id) {
96 published -> Timestamp,
109 published -> Timestamp,
116 recipient_id -> Int4,
119 published -> Timestamp,
124 comment_report (id) {
128 original_comment_text -> Text,
131 resolver_id -> Nullable<Int4>,
132 published -> Timestamp,
133 updated -> Nullable<Timestamp>,
142 published -> Timestamp,
153 description -> Nullable<Text>,
155 published -> Timestamp,
156 updated -> Nullable<Timestamp>,
162 private_key -> Nullable<Text>,
164 last_refreshed_at -> Timestamp,
165 icon -> Nullable<Text>,
166 banner -> Nullable<Text>,
168 followers_url -> Varchar,
170 inbox_url -> Varchar,
172 shared_inbox_url -> Nullable<Varchar>,
174 posting_restricted_to_mods -> Bool,
177 moderators_url -> Nullable<Varchar>,
179 featured_url -> Nullable<Varchar>,
184 community_aggregates (id) {
186 community_id -> Int4,
190 published -> Timestamp,
191 users_active_day -> Int8,
192 users_active_week -> Int8,
193 users_active_month -> Int8,
194 users_active_half_year -> Int8,
200 community_block (id) {
203 community_id -> Int4,
204 published -> Timestamp,
209 community_follower (id) {
211 community_id -> Int4,
213 published -> Timestamp,
219 community_language (id) {
221 community_id -> Int4,
227 community_moderator (id) {
229 community_id -> Int4,
231 published -> Timestamp,
236 community_person_ban (id) {
238 community_id -> Int4,
240 published -> Timestamp,
241 expires -> Nullable<Timestamp>,
248 local_site_id -> Int4,
250 shortcode -> Varchar,
254 published -> Timestamp,
255 updated -> Nullable<Timestamp>,
260 custom_emoji_keyword (id) {
262 custom_emoji_id -> Int4,
269 email_verification (id) {
271 local_user_id -> Int4,
273 verification_token -> Text,
274 published -> Timestamp,
279 federation_allowlist (id) {
282 published -> Timestamp,
283 updated -> Nullable<Timestamp>,
288 federation_blocklist (id) {
291 published -> Timestamp,
292 updated -> Nullable<Timestamp>,
301 published -> Timestamp,
302 updated -> Nullable<Timestamp>,
304 software -> Nullable<Varchar>,
306 version -> Nullable<Varchar>,
320 use diesel::sql_types::{Bool, Int4, Nullable, Text, Timestamp, Varchar};
321 use super::sql_types::ListingTypeEnum;
322 use super::sql_types::RegistrationModeEnum;
328 enable_downvotes -> Bool,
330 community_creation_admin_only -> Bool,
331 require_email_verification -> Bool,
332 application_question -> Nullable<Text>,
333 private_instance -> Bool,
334 default_theme -> Text,
335 default_post_listing_type -> ListingTypeEnum,
336 legal_information -> Nullable<Text>,
337 hide_modlog_mod_names -> Bool,
338 application_email_admins -> Bool,
339 slur_filter_regex -> Nullable<Text>,
340 actor_name_max_length -> Int4,
341 federation_enabled -> Bool,
342 federation_worker_count -> Int4,
343 captcha_enabled -> Bool,
345 captcha_difficulty -> Varchar,
346 published -> Timestamp,
347 updated -> Nullable<Timestamp>,
348 registration_mode -> RegistrationModeEnum,
349 reports_email_admins -> Bool,
354 local_site_rate_limit (id) {
356 local_site_id -> Int4,
358 message_per_second -> Int4,
360 post_per_second -> Int4,
362 register_per_second -> Int4,
364 image_per_second -> Int4,
366 comment_per_second -> Int4,
368 search_per_second -> Int4,
369 published -> Timestamp,
370 updated -> Nullable<Timestamp>,
375 use diesel::sql_types::{Bool, Int4, Nullable, Text, Timestamp, Varchar};
376 use super::sql_types::SortTypeEnum;
377 use super::sql_types::ListingTypeEnum;
382 password_encrypted -> Text,
383 email -> Nullable<Text>,
387 default_sort_type -> SortTypeEnum,
388 default_listing_type -> ListingTypeEnum,
390 interface_language -> Varchar,
391 show_avatars -> Bool,
392 send_notifications_to_email -> Bool,
393 validator_time -> Timestamp,
395 show_bot_accounts -> Bool,
396 show_read_posts -> Bool,
397 show_new_post_notifs -> Bool,
398 email_verified -> Bool,
399 accepted_application -> Bool,
400 totp_2fa_secret -> Nullable<Text>,
401 totp_2fa_url -> Nullable<Text>,
406 local_user_language (id) {
408 local_user_id -> Int4,
416 mod_person_id -> Int4,
417 other_person_id -> Int4,
424 mod_add_community (id) {
426 mod_person_id -> Int4,
427 other_person_id -> Int4,
428 community_id -> Int4,
437 mod_person_id -> Int4,
438 other_person_id -> Int4,
439 reason -> Nullable<Text>,
441 expires -> Nullable<Timestamp>,
447 mod_ban_from_community (id) {
449 mod_person_id -> Int4,
450 other_person_id -> Int4,
451 community_id -> Int4,
452 reason -> Nullable<Text>,
454 expires -> Nullable<Timestamp>,
460 mod_feature_post (id) {
462 mod_person_id -> Int4,
466 is_featured_community -> Bool,
471 mod_hide_community (id) {
473 community_id -> Int4,
474 mod_person_id -> Int4,
476 reason -> Nullable<Text>,
484 mod_person_id -> Int4,
492 mod_remove_comment (id) {
494 mod_person_id -> Int4,
496 reason -> Nullable<Text>,
503 mod_remove_community (id) {
505 mod_person_id -> Int4,
506 community_id -> Int4,
507 reason -> Nullable<Text>,
509 expires -> Nullable<Timestamp>,
515 mod_remove_post (id) {
517 mod_person_id -> Int4,
519 reason -> Nullable<Text>,
526 mod_transfer_community (id) {
528 mod_person_id -> Int4,
529 other_person_id -> Int4,
530 community_id -> Int4,
536 password_reset_request (id) {
538 token_encrypted -> Text,
539 published -> Timestamp,
540 local_user_id -> Int4,
550 display_name -> Nullable<Varchar>,
551 avatar -> Nullable<Text>,
553 published -> Timestamp,
554 updated -> Nullable<Timestamp>,
557 bio -> Nullable<Text>,
559 private_key -> Nullable<Text>,
561 last_refreshed_at -> Timestamp,
562 banner -> Nullable<Text>,
565 inbox_url -> Varchar,
567 shared_inbox_url -> Nullable<Varchar>,
568 matrix_user_id -> Nullable<Text>,
571 ban_expires -> Nullable<Timestamp>,
577 person_aggregates (id) {
582 comment_count -> Int8,
583 comment_score -> Int8,
591 published -> Timestamp,
600 published -> Timestamp,
605 person_follower (id) {
609 published -> Timestamp,
615 person_mention (id) {
617 recipient_id -> Int4,
620 published -> Timestamp,
625 person_post_aggregates (id) {
629 read_comments -> Int8,
630 published -> Timestamp,
640 url -> Nullable<Varchar>,
641 body -> Nullable<Text>,
643 community_id -> Int4,
646 published -> Timestamp,
647 updated -> Nullable<Timestamp>,
650 embed_title -> Nullable<Text>,
651 embed_description -> Nullable<Text>,
652 thumbnail_url -> Nullable<Text>,
656 embed_video_url -> Nullable<Text>,
658 featured_community -> Bool,
659 featured_local -> Bool,
664 post_aggregates (id) {
671 published -> Timestamp,
672 newest_comment_time_necro -> Timestamp,
673 newest_comment_time -> Timestamp,
674 featured_community -> Bool,
675 featured_local -> Bool,
677 hot_rank_active -> Int4,
687 published -> Timestamp,
696 published -> Timestamp,
706 original_post_name -> Varchar,
707 original_post_url -> Nullable<Text>,
708 original_post_body -> Nullable<Text>,
711 resolver_id -> Nullable<Int4>,
712 published -> Timestamp,
713 updated -> Nullable<Timestamp>,
722 published -> Timestamp,
727 private_message (id) {
730 recipient_id -> Int4,
734 published -> Timestamp,
735 updated -> Nullable<Timestamp>,
743 private_message_report (id) {
746 private_message_id -> Int4,
747 original_pm_text -> Text,
750 resolver_id -> Nullable<Int4>,
751 published -> Timestamp,
752 updated -> Nullable<Timestamp>,
757 registration_application (id) {
759 local_user_id -> Int4,
761 admin_id -> Nullable<Int4>,
762 deny_reason -> Nullable<Text>,
763 published -> Timestamp,
770 jwt_secret -> Varchar,
779 sidebar -> Nullable<Text>,
780 published -> Timestamp,
781 updated -> Nullable<Timestamp>,
782 icon -> Nullable<Text>,
783 banner -> Nullable<Text>,
785 description -> Nullable<Varchar>,
788 last_refreshed_at -> Timestamp,
790 inbox_url -> Varchar,
791 private_key -> Nullable<Text>,
798 site_aggregates (id) {
805 users_active_day -> Int8,
806 users_active_week -> Int8,
807 users_active_month -> Int8,
808 users_active_half_year -> Int8,
823 local_site_id -> Int4,
825 published -> Timestamp,
826 updated -> Nullable<Timestamp>,
830 diesel::joinable!(admin_purge_comment -> person (admin_person_id));
831 diesel::joinable!(admin_purge_comment -> post (post_id));
832 diesel::joinable!(admin_purge_community -> person (admin_person_id));
833 diesel::joinable!(admin_purge_person -> person (admin_person_id));
834 diesel::joinable!(admin_purge_post -> community (community_id));
835 diesel::joinable!(admin_purge_post -> person (admin_person_id));
836 diesel::joinable!(comment -> language (language_id));
837 diesel::joinable!(comment -> person (creator_id));
838 diesel::joinable!(comment -> post (post_id));
839 diesel::joinable!(comment_aggregates -> comment (comment_id));
840 diesel::joinable!(comment_like -> comment (comment_id));
841 diesel::joinable!(comment_like -> person (person_id));
842 diesel::joinable!(comment_like -> post (post_id));
843 diesel::joinable!(comment_reply -> comment (comment_id));
844 diesel::joinable!(comment_reply -> person (recipient_id));
845 diesel::joinable!(comment_report -> comment (comment_id));
846 diesel::joinable!(comment_saved -> comment (comment_id));
847 diesel::joinable!(comment_saved -> person (person_id));
848 diesel::joinable!(community -> instance (instance_id));
849 diesel::joinable!(community_aggregates -> community (community_id));
850 diesel::joinable!(community_block -> community (community_id));
851 diesel::joinable!(community_block -> person (person_id));
852 diesel::joinable!(community_follower -> community (community_id));
853 diesel::joinable!(community_follower -> person (person_id));
854 diesel::joinable!(community_language -> community (community_id));
855 diesel::joinable!(community_language -> language (language_id));
856 diesel::joinable!(community_moderator -> community (community_id));
857 diesel::joinable!(community_moderator -> person (person_id));
858 diesel::joinable!(community_person_ban -> community (community_id));
859 diesel::joinable!(community_person_ban -> person (person_id));
860 diesel::joinable!(custom_emoji -> local_site (local_site_id));
861 diesel::joinable!(custom_emoji_keyword -> custom_emoji (custom_emoji_id));
862 diesel::joinable!(email_verification -> local_user (local_user_id));
863 diesel::joinable!(federation_allowlist -> instance (instance_id));
864 diesel::joinable!(federation_blocklist -> instance (instance_id));
865 diesel::joinable!(local_site -> site (site_id));
866 diesel::joinable!(local_site_rate_limit -> local_site (local_site_id));
867 diesel::joinable!(local_user -> person (person_id));
868 diesel::joinable!(local_user_language -> language (language_id));
869 diesel::joinable!(local_user_language -> local_user (local_user_id));
870 diesel::joinable!(mod_add_community -> community (community_id));
871 diesel::joinable!(mod_ban_from_community -> community (community_id));
872 diesel::joinable!(mod_feature_post -> person (mod_person_id));
873 diesel::joinable!(mod_feature_post -> post (post_id));
874 diesel::joinable!(mod_hide_community -> community (community_id));
875 diesel::joinable!(mod_hide_community -> person (mod_person_id));
876 diesel::joinable!(mod_lock_post -> person (mod_person_id));
877 diesel::joinable!(mod_lock_post -> post (post_id));
878 diesel::joinable!(mod_remove_comment -> comment (comment_id));
879 diesel::joinable!(mod_remove_comment -> person (mod_person_id));
880 diesel::joinable!(mod_remove_community -> community (community_id));
881 diesel::joinable!(mod_remove_community -> person (mod_person_id));
882 diesel::joinable!(mod_remove_post -> person (mod_person_id));
883 diesel::joinable!(mod_remove_post -> post (post_id));
884 diesel::joinable!(mod_transfer_community -> community (community_id));
885 diesel::joinable!(password_reset_request -> local_user (local_user_id));
886 diesel::joinable!(person -> instance (instance_id));
887 diesel::joinable!(person_aggregates -> person (person_id));
888 diesel::joinable!(person_ban -> person (person_id));
889 diesel::joinable!(person_mention -> comment (comment_id));
890 diesel::joinable!(person_mention -> person (recipient_id));
891 diesel::joinable!(person_post_aggregates -> person (person_id));
892 diesel::joinable!(person_post_aggregates -> post (post_id));
893 diesel::joinable!(post -> community (community_id));
894 diesel::joinable!(post -> language (language_id));
895 diesel::joinable!(post -> person (creator_id));
896 diesel::joinable!(post_aggregates -> post (post_id));
897 diesel::joinable!(post_like -> person (person_id));
898 diesel::joinable!(post_like -> post (post_id));
899 diesel::joinable!(post_read -> person (person_id));
900 diesel::joinable!(post_read -> post (post_id));
901 diesel::joinable!(post_report -> post (post_id));
902 diesel::joinable!(post_saved -> person (person_id));
903 diesel::joinable!(post_saved -> post (post_id));
904 diesel::joinable!(private_message_report -> private_message (private_message_id));
905 diesel::joinable!(registration_application -> local_user (local_user_id));
906 diesel::joinable!(registration_application -> person (admin_id));
907 diesel::joinable!(site -> instance (instance_id));
908 diesel::joinable!(site_aggregates -> site (site_id));
909 diesel::joinable!(site_language -> language (language_id));
910 diesel::joinable!(site_language -> site (site_id));
911 diesel::joinable!(tagline -> local_site (local_site_id));
913 diesel::allow_tables_to_appear_in_same_query!(
916 admin_purge_community,
926 community_aggregates,
931 community_person_ban,
933 custom_emoji_keyword,
935 federation_allowlist,
936 federation_blocklist,
940 local_site_rate_limit,
946 mod_ban_from_community,
951 mod_remove_community,
953 mod_transfer_community,
954 password_reset_request,
961 person_post_aggregates,
969 private_message_report,
970 registration_application,