6 published -> Timestamp,
7 updated -> Nullable<Timestamp>,
8 ap_id -> Nullable<Text>,
9 sensitive -> Nullable<Bool>,
18 parent_id -> Nullable<Int4>,
22 published -> Timestamp,
23 updated -> Nullable<Timestamp>,
31 comment_aggregates (id) {
37 published -> Timestamp,
48 published -> Timestamp,
57 original_comment_text -> Text,
60 resolver_id -> Nullable<Int4>,
61 published -> Timestamp,
62 updated -> Nullable<Timestamp>,
71 published -> Timestamp,
80 description -> Nullable<Text>,
82 published -> Timestamp,
83 updated -> Nullable<Timestamp>,
88 private_key -> Nullable<Text>,
89 public_key -> Nullable<Text>,
90 last_refreshed_at -> Timestamp,
91 icon -> Nullable<Varchar>,
92 banner -> Nullable<Varchar>,
93 followers_url -> Varchar,
95 shared_inbox_url -> Nullable<Varchar>,
100 community_aggregates (id) {
102 community_id -> Int4,
106 published -> Timestamp,
107 users_active_day -> Int8,
108 users_active_week -> Int8,
109 users_active_month -> Int8,
110 users_active_half_year -> Int8,
115 community_follower (id) {
117 community_id -> Int4,
119 published -> Timestamp,
120 pending -> Nullable<Bool>,
125 community_moderator (id) {
127 community_id -> Int4,
129 published -> Timestamp,
134 community_person_ban (id) {
136 community_id -> Int4,
138 published -> Timestamp,
146 password_encrypted -> Text,
147 email -> Nullable<Text>,
150 default_sort_type -> Int2,
151 default_listing_type -> Int2,
153 show_avatars -> Bool,
154 send_notifications_to_email -> Bool,
155 validator_time -> Timestamp,
156 show_bot_accounts -> Bool,
158 show_read_posts -> Bool,
159 show_new_post_notifs -> Bool,
166 mod_person_id -> Int4,
167 other_person_id -> Int4,
168 removed -> Nullable<Bool>,
174 mod_add_community (id) {
176 mod_person_id -> Int4,
177 other_person_id -> Int4,
178 community_id -> Int4,
179 removed -> Nullable<Bool>,
185 mod_transfer_community (id) {
187 mod_person_id -> Int4,
188 other_person_id -> Int4,
189 community_id -> Int4,
190 removed -> Nullable<Bool>,
198 mod_person_id -> Int4,
199 other_person_id -> Int4,
200 reason -> Nullable<Text>,
201 banned -> Nullable<Bool>,
202 expires -> Nullable<Timestamp>,
208 mod_ban_from_community (id) {
210 mod_person_id -> Int4,
211 other_person_id -> Int4,
212 community_id -> Int4,
213 reason -> Nullable<Text>,
214 banned -> Nullable<Bool>,
215 expires -> Nullable<Timestamp>,
223 mod_person_id -> Int4,
225 locked -> Nullable<Bool>,
231 mod_remove_comment (id) {
233 mod_person_id -> Int4,
235 reason -> Nullable<Text>,
236 removed -> Nullable<Bool>,
242 mod_remove_community (id) {
244 mod_person_id -> Int4,
245 community_id -> Int4,
246 reason -> Nullable<Text>,
247 removed -> Nullable<Bool>,
248 expires -> Nullable<Timestamp>,
254 mod_remove_post (id) {
256 mod_person_id -> Int4,
258 reason -> Nullable<Text>,
259 removed -> Nullable<Bool>,
265 mod_sticky_post (id) {
267 mod_person_id -> Int4,
269 stickied -> Nullable<Bool>,
275 password_reset_request (id) {
277 token_encrypted -> Text,
278 published -> Timestamp,
279 local_user_id -> Int4,
287 display_name -> Nullable<Varchar>,
288 avatar -> Nullable<Varchar>,
290 published -> Timestamp,
291 updated -> Nullable<Timestamp>,
293 bio -> Nullable<Text>,
295 private_key -> Nullable<Text>,
296 public_key -> Nullable<Text>,
297 last_refreshed_at -> Timestamp,
298 banner -> Nullable<Varchar>,
300 inbox_url -> Varchar,
301 shared_inbox_url -> Nullable<Varchar>,
302 matrix_user_id -> Nullable<Text>,
309 person_aggregates (id) {
314 comment_count -> Int8,
315 comment_score -> Int8,
323 published -> Timestamp,
328 person_mention (id) {
330 recipient_id -> Int4,
333 published -> Timestamp,
341 url -> Nullable<Varchar>,
342 body -> Nullable<Text>,
344 community_id -> Int4,
347 published -> Timestamp,
348 updated -> Nullable<Timestamp>,
352 embed_title -> Nullable<Text>,
353 embed_description -> Nullable<Text>,
354 embed_html -> Nullable<Text>,
355 thumbnail_url -> Nullable<Text>,
362 post_aggregates (id) {
370 published -> Timestamp,
371 newest_comment_time_necro -> Timestamp,
372 newest_comment_time -> Timestamp,
382 published -> Timestamp,
391 published -> Timestamp,
400 original_post_name -> Varchar,
401 original_post_url -> Nullable<Text>,
402 original_post_body -> Nullable<Text>,
405 resolver_id -> Nullable<Int4>,
406 published -> Timestamp,
407 updated -> Nullable<Timestamp>,
416 published -> Timestamp,
421 private_message (id) {
424 recipient_id -> Int4,
428 published -> Timestamp,
429 updated -> Nullable<Timestamp>,
439 sidebar -> Nullable<Text>,
441 published -> Timestamp,
442 updated -> Nullable<Timestamp>,
443 enable_downvotes -> Bool,
444 open_registration -> Bool,
446 icon -> Nullable<Varchar>,
447 banner -> Nullable<Varchar>,
448 description -> Nullable<Text>,
449 community_creation_admin_only -> Bool,
454 site_aggregates (id) {
461 users_active_day -> Int8,
462 users_active_week -> Int8,
463 users_active_month -> Int8,
464 users_active_half_year -> Int8,
473 published -> Timestamp,
478 community_block (id) {
481 community_id -> Int4,
482 published -> Timestamp,
486 // These are necessary since diesel doesn't have self joins / aliases
488 comment_alias_1 (id) {
492 parent_id -> Nullable<Int4>,
496 published -> Timestamp,
497 updated -> Nullable<Timestamp>,
505 person_alias_1 (id) {
508 display_name -> Nullable<Varchar>,
509 avatar -> Nullable<Varchar>,
511 published -> Timestamp,
512 updated -> Nullable<Timestamp>,
514 bio -> Nullable<Text>,
516 private_key -> Nullable<Text>,
517 public_key -> Nullable<Text>,
518 last_refreshed_at -> Timestamp,
519 banner -> Nullable<Varchar>,
521 inbox_url -> Varchar,
522 shared_inbox_url -> Nullable<Varchar>,
523 matrix_user_id -> Nullable<Text>,
530 person_alias_2 (id) {
533 display_name -> Nullable<Varchar>,
534 avatar -> Nullable<Varchar>,
536 published -> Timestamp,
537 updated -> Nullable<Timestamp>,
539 bio -> Nullable<Text>,
541 private_key -> Nullable<Text>,
542 public_key -> Nullable<Text>,
543 last_refreshed_at -> Timestamp,
544 banner -> Nullable<Varchar>,
546 inbox_url -> Varchar,
547 shared_inbox_url -> Nullable<Varchar>,
548 matrix_user_id -> Nullable<Text>,
554 joinable!(comment_alias_1 -> person_alias_1 (creator_id));
555 joinable!(comment -> comment_alias_1 (parent_id));
556 joinable!(person_mention -> person_alias_1 (recipient_id));
557 joinable!(post -> person_alias_1 (creator_id));
558 joinable!(comment -> person_alias_1 (creator_id));
560 joinable!(post_report -> person_alias_2 (resolver_id));
561 joinable!(comment_report -> person_alias_2 (resolver_id));
563 joinable!(person_block -> person (person_id));
564 joinable!(person_block -> person_alias_1 (target_id));
566 joinable!(comment -> person (creator_id));
567 joinable!(comment -> post (post_id));
568 joinable!(comment_aggregates -> comment (comment_id));
569 joinable!(comment_like -> comment (comment_id));
570 joinable!(comment_like -> person (person_id));
571 joinable!(comment_like -> post (post_id));
572 joinable!(comment_report -> comment (comment_id));
573 joinable!(comment_saved -> comment (comment_id));
574 joinable!(comment_saved -> person (person_id));
575 joinable!(community_aggregates -> community (community_id));
576 joinable!(community_block -> community (community_id));
577 joinable!(community_block -> person (person_id));
578 joinable!(community_follower -> community (community_id));
579 joinable!(community_follower -> person (person_id));
580 joinable!(community_moderator -> community (community_id));
581 joinable!(community_moderator -> person (person_id));
582 joinable!(community_person_ban -> community (community_id));
583 joinable!(community_person_ban -> person (person_id));
584 joinable!(local_user -> person (person_id));
585 joinable!(mod_add_community -> community (community_id));
586 joinable!(mod_transfer_community -> community (community_id));
587 joinable!(mod_ban_from_community -> community (community_id));
588 joinable!(mod_lock_post -> person (mod_person_id));
589 joinable!(mod_lock_post -> post (post_id));
590 joinable!(mod_remove_comment -> comment (comment_id));
591 joinable!(mod_remove_comment -> person (mod_person_id));
592 joinable!(mod_remove_community -> community (community_id));
593 joinable!(mod_remove_community -> person (mod_person_id));
594 joinable!(mod_remove_post -> person (mod_person_id));
595 joinable!(mod_remove_post -> post (post_id));
596 joinable!(mod_sticky_post -> person (mod_person_id));
597 joinable!(mod_sticky_post -> post (post_id));
598 joinable!(password_reset_request -> local_user (local_user_id));
599 joinable!(person_aggregates -> person (person_id));
600 joinable!(person_ban -> person (person_id));
601 joinable!(person_mention -> comment (comment_id));
602 joinable!(person_mention -> person (recipient_id));
603 joinable!(post -> community (community_id));
604 joinable!(post -> person (creator_id));
605 joinable!(post_aggregates -> post (post_id));
606 joinable!(post_like -> person (person_id));
607 joinable!(post_like -> post (post_id));
608 joinable!(post_read -> person (person_id));
609 joinable!(post_read -> post (post_id));
610 joinable!(post_report -> post (post_id));
611 joinable!(post_saved -> person (person_id));
612 joinable!(post_saved -> post (post_id));
613 joinable!(site -> person (creator_id));
614 joinable!(site_aggregates -> site (site_id));
616 allow_tables_to_appear_in_same_query!(
625 community_aggregates,
628 community_person_ban,
632 mod_transfer_community,
634 mod_ban_from_community,
637 mod_remove_community,
640 password_reset_request,