6 published -> Timestamp,
7 updated -> Nullable<Timestamp>,
8 ap_id -> Nullable<Text>,
9 sensitive -> Nullable<Bool>,
25 parent_id -> Nullable<Int4>,
29 published -> Timestamp,
30 updated -> Nullable<Timestamp>,
38 comment_aggregates (id) {
48 comment_aggregates_fast (id) {
50 creator_id -> Nullable<Int4>,
51 post_id -> Nullable<Int4>,
52 parent_id -> Nullable<Int4>,
53 content -> Nullable<Text>,
54 removed -> Nullable<Bool>,
55 read -> Nullable<Bool>,
56 published -> Nullable<Timestamp>,
57 updated -> Nullable<Timestamp>,
58 deleted -> Nullable<Bool>,
59 ap_id -> Nullable<Varchar>,
60 local -> Nullable<Bool>,
61 post_name -> Nullable<Varchar>,
62 community_id -> Nullable<Int4>,
63 community_actor_id -> Nullable<Varchar>,
64 community_local -> Nullable<Bool>,
65 community_name -> Nullable<Varchar>,
66 community_icon -> Nullable<Text>,
67 banned -> Nullable<Bool>,
68 banned_from_community -> Nullable<Bool>,
69 creator_actor_id -> Nullable<Varchar>,
70 creator_local -> Nullable<Bool>,
71 creator_name -> Nullable<Varchar>,
72 creator_preferred_username -> Nullable<Varchar>,
73 creator_published -> Nullable<Timestamp>,
74 creator_avatar -> Nullable<Text>,
75 score -> Nullable<Int8>,
76 upvotes -> Nullable<Int8>,
77 downvotes -> Nullable<Int8>,
78 hot_rank -> Nullable<Int4>,
79 hot_rank_active -> Nullable<Int4>,
90 published -> Timestamp,
99 original_comment_text -> Text,
102 resolver_id -> Nullable<Int4>,
103 published -> Timestamp,
104 updated -> Nullable<Timestamp>,
113 published -> Timestamp,
122 description -> Nullable<Text>,
126 published -> Timestamp,
127 updated -> Nullable<Timestamp>,
132 private_key -> Nullable<Text>,
133 public_key -> Nullable<Text>,
134 last_refreshed_at -> Timestamp,
135 icon -> Nullable<Text>,
136 banner -> Nullable<Text>,
141 community_aggregates (id) {
143 community_id -> Int4,
151 community_aggregates_fast (id) {
153 name -> Nullable<Varchar>,
154 title -> Nullable<Varchar>,
155 icon -> Nullable<Text>,
156 banner -> Nullable<Text>,
157 description -> Nullable<Text>,
158 category_id -> Nullable<Int4>,
159 creator_id -> Nullable<Int4>,
160 removed -> Nullable<Bool>,
161 published -> Nullable<Timestamp>,
162 updated -> Nullable<Timestamp>,
163 deleted -> Nullable<Bool>,
164 nsfw -> Nullable<Bool>,
165 actor_id -> Nullable<Varchar>,
166 local -> Nullable<Bool>,
167 last_refreshed_at -> Nullable<Timestamp>,
168 creator_actor_id -> Nullable<Varchar>,
169 creator_local -> Nullable<Bool>,
170 creator_name -> Nullable<Varchar>,
171 creator_preferred_username -> Nullable<Varchar>,
172 creator_avatar -> Nullable<Text>,
173 category_name -> Nullable<Varchar>,
174 number_of_subscribers -> Nullable<Int8>,
175 number_of_posts -> Nullable<Int8>,
176 number_of_comments -> Nullable<Int8>,
177 hot_rank -> Nullable<Int4>,
182 community_follower (id) {
184 community_id -> Int4,
186 published -> Timestamp,
187 pending -> Nullable<Bool>,
192 community_moderator (id) {
194 community_id -> Int4,
196 published -> Timestamp,
201 community_user_ban (id) {
203 community_id -> Int4,
205 published -> Timestamp,
213 other_user_id -> Int4,
214 removed -> Nullable<Bool>,
220 mod_add_community (id) {
223 other_user_id -> Int4,
224 community_id -> Int4,
225 removed -> Nullable<Bool>,
234 other_user_id -> Int4,
235 reason -> Nullable<Text>,
236 banned -> Nullable<Bool>,
237 expires -> Nullable<Timestamp>,
243 mod_ban_from_community (id) {
246 other_user_id -> Int4,
247 community_id -> Int4,
248 reason -> Nullable<Text>,
249 banned -> Nullable<Bool>,
250 expires -> Nullable<Timestamp>,
260 locked -> Nullable<Bool>,
266 mod_remove_comment (id) {
270 reason -> Nullable<Text>,
271 removed -> Nullable<Bool>,
277 mod_remove_community (id) {
280 community_id -> Int4,
281 reason -> Nullable<Text>,
282 removed -> Nullable<Bool>,
283 expires -> Nullable<Timestamp>,
289 mod_remove_post (id) {
293 reason -> Nullable<Text>,
294 removed -> Nullable<Bool>,
300 mod_sticky_post (id) {
304 stickied -> Nullable<Bool>,
310 password_reset_request (id) {
313 token_encrypted -> Text,
314 published -> Timestamp,
322 url -> Nullable<Text>,
323 body -> Nullable<Text>,
325 community_id -> Int4,
328 published -> Timestamp,
329 updated -> Nullable<Timestamp>,
333 embed_title -> Nullable<Text>,
334 embed_description -> Nullable<Text>,
335 embed_html -> Nullable<Text>,
336 thumbnail_url -> Nullable<Text>,
343 post_aggregates (id) {
350 newest_comment_time -> Timestamp,
355 post_aggregates_fast (id) {
357 name -> Nullable<Varchar>,
358 url -> Nullable<Text>,
359 body -> Nullable<Text>,
360 creator_id -> Nullable<Int4>,
361 community_id -> Nullable<Int4>,
362 removed -> Nullable<Bool>,
363 locked -> Nullable<Bool>,
364 published -> Nullable<Timestamp>,
365 updated -> Nullable<Timestamp>,
366 deleted -> Nullable<Bool>,
367 nsfw -> Nullable<Bool>,
368 stickied -> Nullable<Bool>,
369 embed_title -> Nullable<Text>,
370 embed_description -> Nullable<Text>,
371 embed_html -> Nullable<Text>,
372 thumbnail_url -> Nullable<Text>,
373 ap_id -> Nullable<Varchar>,
374 local -> Nullable<Bool>,
375 creator_actor_id -> Nullable<Varchar>,
376 creator_local -> Nullable<Bool>,
377 creator_name -> Nullable<Varchar>,
378 creator_preferred_username -> Nullable<Varchar>,
379 creator_published -> Nullable<Timestamp>,
380 creator_avatar -> Nullable<Text>,
381 banned -> Nullable<Bool>,
382 banned_from_community -> Nullable<Bool>,
383 community_actor_id -> Nullable<Varchar>,
384 community_local -> Nullable<Bool>,
385 community_name -> Nullable<Varchar>,
386 community_icon -> Nullable<Text>,
387 community_removed -> Nullable<Bool>,
388 community_deleted -> Nullable<Bool>,
389 community_nsfw -> Nullable<Bool>,
390 number_of_comments -> Nullable<Int8>,
391 score -> Nullable<Int8>,
392 upvotes -> Nullable<Int8>,
393 downvotes -> Nullable<Int8>,
394 hot_rank -> Nullable<Int4>,
395 hot_rank_active -> Nullable<Int4>,
396 newest_activity_time -> Nullable<Timestamp>,
406 published -> Timestamp,
415 published -> Timestamp,
424 original_post_name -> Varchar,
425 original_post_url -> Nullable<Text>,
426 original_post_body -> Nullable<Text>,
429 resolver_id -> Nullable<Int4>,
430 published -> Timestamp,
431 updated -> Nullable<Timestamp>,
440 published -> Timestamp,
445 private_message (id) {
448 recipient_id -> Int4,
452 published -> Timestamp,
453 updated -> Nullable<Timestamp>,
463 description -> Nullable<Text>,
465 published -> Timestamp,
466 updated -> Nullable<Timestamp>,
467 enable_downvotes -> Bool,
468 open_registration -> Bool,
470 icon -> Nullable<Text>,
471 banner -> Nullable<Text>,
476 site_aggregates (id) {
489 preferred_username -> Nullable<Varchar>,
490 password_encrypted -> Text,
491 email -> Nullable<Text>,
492 avatar -> Nullable<Text>,
495 published -> Timestamp,
496 updated -> Nullable<Timestamp>,
499 default_sort_type -> Int2,
500 default_listing_type -> Int2,
502 show_avatars -> Bool,
503 send_notifications_to_email -> Bool,
504 matrix_user_id -> Nullable<Text>,
506 bio -> Nullable<Text>,
508 private_key -> Nullable<Text>,
509 public_key -> Nullable<Text>,
510 last_refreshed_at -> Timestamp,
511 banner -> Nullable<Text>,
517 user_aggregates (id) {
522 comment_count -> Int8,
523 comment_score -> Int8,
531 published -> Timestamp,
538 actor_id -> Nullable<Varchar>,
539 name -> Nullable<Varchar>,
540 preferred_username -> Nullable<Varchar>,
541 avatar -> Nullable<Text>,
542 banner -> Nullable<Text>,
543 email -> Nullable<Text>,
544 matrix_user_id -> Nullable<Text>,
545 bio -> Nullable<Text>,
546 local -> Nullable<Bool>,
547 admin -> Nullable<Bool>,
548 banned -> Nullable<Bool>,
549 show_avatars -> Nullable<Bool>,
550 send_notifications_to_email -> Nullable<Bool>,
551 published -> Nullable<Timestamp>,
552 number_of_posts -> Nullable<Int8>,
553 post_score -> Nullable<Int8>,
554 number_of_comments -> Nullable<Int8>,
555 comment_score -> Nullable<Int8>,
562 recipient_id -> Int4,
565 published -> Timestamp,
569 // These are necessary since diesel doesn't have self joins / aliases
571 comment_alias_1 (id) {
575 parent_id -> Nullable<Int4>,
579 published -> Timestamp,
580 updated -> Nullable<Timestamp>,
591 preferred_username -> Nullable<Varchar>,
592 password_encrypted -> Text,
593 email -> Nullable<Text>,
594 avatar -> Nullable<Text>,
597 published -> Timestamp,
598 updated -> Nullable<Timestamp>,
601 default_sort_type -> Int2,
602 default_listing_type -> Int2,
604 show_avatars -> Bool,
605 send_notifications_to_email -> Bool,
606 matrix_user_id -> Nullable<Text>,
608 bio -> Nullable<Text>,
610 private_key -> Nullable<Text>,
611 public_key -> Nullable<Text>,
612 last_refreshed_at -> Timestamp,
613 banner -> Nullable<Text>,
622 preferred_username -> Nullable<Varchar>,
623 password_encrypted -> Text,
624 email -> Nullable<Text>,
625 avatar -> Nullable<Text>,
628 published -> Timestamp,
629 updated -> Nullable<Timestamp>,
632 default_sort_type -> Int2,
633 default_listing_type -> Int2,
635 show_avatars -> Bool,
636 send_notifications_to_email -> Bool,
637 matrix_user_id -> Nullable<Text>,
639 bio -> Nullable<Text>,
641 private_key -> Nullable<Text>,
642 public_key -> Nullable<Text>,
643 last_refreshed_at -> Timestamp,
644 banner -> Nullable<Text>,
649 joinable!(comment_alias_1 -> user_alias_1 (creator_id));
650 joinable!(comment -> comment_alias_1 (parent_id));
651 joinable!(user_mention -> user_alias_1 (recipient_id));
652 joinable!(post -> user_alias_1 (creator_id));
653 joinable!(comment -> user_alias_1 (creator_id));
655 joinable!(post_report -> user_alias_2 (resolver_id));
656 joinable!(comment_report -> user_alias_2 (resolver_id));
658 joinable!(comment -> post (post_id));
659 joinable!(comment -> user_ (creator_id));
660 joinable!(comment_aggregates -> comment (comment_id));
661 joinable!(comment_like -> comment (comment_id));
662 joinable!(comment_like -> post (post_id));
663 joinable!(comment_like -> user_ (user_id));
664 joinable!(comment_report -> comment (comment_id));
665 joinable!(comment_saved -> comment (comment_id));
666 joinable!(comment_saved -> user_ (user_id));
667 joinable!(community -> category (category_id));
668 joinable!(community -> user_ (creator_id));
669 joinable!(community_aggregates -> community (community_id));
670 joinable!(community_follower -> community (community_id));
671 joinable!(community_follower -> user_ (user_id));
672 joinable!(community_moderator -> community (community_id));
673 joinable!(community_moderator -> user_ (user_id));
674 joinable!(community_user_ban -> community (community_id));
675 joinable!(community_user_ban -> user_ (user_id));
676 joinable!(mod_add_community -> community (community_id));
677 joinable!(mod_ban_from_community -> community (community_id));
678 joinable!(mod_lock_post -> post (post_id));
679 joinable!(mod_lock_post -> user_ (mod_user_id));
680 joinable!(mod_remove_comment -> comment (comment_id));
681 joinable!(mod_remove_comment -> user_ (mod_user_id));
682 joinable!(mod_remove_community -> community (community_id));
683 joinable!(mod_remove_community -> user_ (mod_user_id));
684 joinable!(mod_remove_post -> post (post_id));
685 joinable!(mod_remove_post -> user_ (mod_user_id));
686 joinable!(mod_sticky_post -> post (post_id));
687 joinable!(mod_sticky_post -> user_ (mod_user_id));
688 joinable!(password_reset_request -> user_ (user_id));
689 joinable!(post -> community (community_id));
690 joinable!(post -> user_ (creator_id));
691 joinable!(post_aggregates -> post (post_id));
692 joinable!(post_like -> post (post_id));
693 joinable!(post_like -> user_ (user_id));
694 joinable!(post_read -> post (post_id));
695 joinable!(post_read -> user_ (user_id));
696 joinable!(post_report -> post (post_id));
697 joinable!(post_saved -> post (post_id));
698 joinable!(post_saved -> user_ (user_id));
699 joinable!(site -> user_ (creator_id));
700 joinable!(user_aggregates -> user_ (user_id));
701 joinable!(user_ban -> user_ (user_id));
702 joinable!(user_mention -> comment (comment_id));
703 joinable!(user_mention -> user_ (recipient_id));
705 allow_tables_to_appear_in_same_query!(
710 comment_aggregates_fast,
715 community_aggregates,
716 community_aggregates_fast,
723 mod_ban_from_community,
726 mod_remove_community,
729 password_reset_request,
732 post_aggregates_fast,