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) {
44 published -> Timestamp,
55 published -> Timestamp,
64 original_comment_text -> Text,
67 resolver_id -> Nullable<Int4>,
68 published -> Timestamp,
69 updated -> Nullable<Timestamp>,
78 published -> Timestamp,
87 description -> Nullable<Text>,
91 published -> Timestamp,
92 updated -> Nullable<Timestamp>,
97 private_key -> Nullable<Text>,
98 public_key -> Nullable<Text>,
99 last_refreshed_at -> Timestamp,
100 icon -> Nullable<Text>,
101 banner -> Nullable<Text>,
102 followers_url -> Text,
104 shared_inbox_url -> Nullable<Text>,
109 community_aggregates (id) {
111 community_id -> Int4,
115 published -> Timestamp,
116 users_active_day -> Int8,
117 users_active_week -> Int8,
118 users_active_month -> Int8,
119 users_active_half_year -> Int8,
124 community_follower (id) {
126 community_id -> Int4,
128 published -> Timestamp,
129 pending -> Nullable<Bool>,
134 community_moderator (id) {
136 community_id -> Int4,
138 published -> Timestamp,
143 community_user_ban (id) {
145 community_id -> Int4,
147 published -> Timestamp,
155 other_user_id -> Int4,
156 removed -> Nullable<Bool>,
162 mod_add_community (id) {
165 other_user_id -> Int4,
166 community_id -> Int4,
167 removed -> Nullable<Bool>,
176 other_user_id -> Int4,
177 reason -> Nullable<Text>,
178 banned -> Nullable<Bool>,
179 expires -> Nullable<Timestamp>,
185 mod_ban_from_community (id) {
188 other_user_id -> Int4,
189 community_id -> Int4,
190 reason -> Nullable<Text>,
191 banned -> Nullable<Bool>,
192 expires -> Nullable<Timestamp>,
202 locked -> Nullable<Bool>,
208 mod_remove_comment (id) {
212 reason -> Nullable<Text>,
213 removed -> Nullable<Bool>,
219 mod_remove_community (id) {
222 community_id -> Int4,
223 reason -> Nullable<Text>,
224 removed -> Nullable<Bool>,
225 expires -> Nullable<Timestamp>,
231 mod_remove_post (id) {
235 reason -> Nullable<Text>,
236 removed -> Nullable<Bool>,
242 mod_sticky_post (id) {
246 stickied -> Nullable<Bool>,
252 password_reset_request (id) {
255 token_encrypted -> Text,
256 published -> Timestamp,
264 url -> Nullable<Text>,
265 body -> Nullable<Text>,
267 community_id -> Int4,
270 published -> Timestamp,
271 updated -> Nullable<Timestamp>,
275 embed_title -> Nullable<Text>,
276 embed_description -> Nullable<Text>,
277 embed_html -> Nullable<Text>,
278 thumbnail_url -> Nullable<Text>,
285 post_aggregates (id) {
293 published -> Timestamp,
294 newest_comment_time_necro -> Timestamp,
295 newest_comment_time -> Timestamp,
305 published -> Timestamp,
314 published -> Timestamp,
323 original_post_name -> Varchar,
324 original_post_url -> Nullable<Text>,
325 original_post_body -> Nullable<Text>,
328 resolver_id -> Nullable<Int4>,
329 published -> Timestamp,
330 updated -> Nullable<Timestamp>,
339 published -> Timestamp,
344 private_message (id) {
347 recipient_id -> Int4,
351 published -> Timestamp,
352 updated -> Nullable<Timestamp>,
362 description -> Nullable<Text>,
364 published -> Timestamp,
365 updated -> Nullable<Timestamp>,
366 enable_downvotes -> Bool,
367 open_registration -> Bool,
369 icon -> Nullable<Text>,
370 banner -> Nullable<Text>,
375 site_aggregates (id) {
382 users_active_day -> Int8,
383 users_active_week -> Int8,
384 users_active_month -> Int8,
385 users_active_half_year -> Int8,
393 preferred_username -> Nullable<Varchar>,
394 password_encrypted -> Text,
395 email -> Nullable<Text>,
396 avatar -> Nullable<Text>,
399 published -> Timestamp,
400 updated -> Nullable<Timestamp>,
403 default_sort_type -> Int2,
404 default_listing_type -> Int2,
406 show_avatars -> Bool,
407 send_notifications_to_email -> Bool,
408 matrix_user_id -> Nullable<Text>,
410 bio -> Nullable<Text>,
412 private_key -> Nullable<Text>,
413 public_key -> Nullable<Text>,
414 last_refreshed_at -> Timestamp,
415 banner -> Nullable<Text>,
418 shared_inbox_url -> Nullable<Text>,
423 user_aggregates (id) {
428 comment_count -> Int8,
429 comment_score -> Int8,
437 published -> Timestamp,
444 recipient_id -> Int4,
447 published -> Timestamp,
451 // These are necessary since diesel doesn't have self joins / aliases
453 comment_alias_1 (id) {
457 parent_id -> Nullable<Int4>,
461 published -> Timestamp,
462 updated -> Nullable<Timestamp>,
473 preferred_username -> Nullable<Varchar>,
474 password_encrypted -> Text,
475 email -> Nullable<Text>,
476 avatar -> Nullable<Text>,
479 published -> Timestamp,
480 updated -> Nullable<Timestamp>,
483 default_sort_type -> Int2,
484 default_listing_type -> Int2,
486 show_avatars -> Bool,
487 send_notifications_to_email -> Bool,
488 matrix_user_id -> Nullable<Text>,
490 bio -> Nullable<Text>,
492 private_key -> Nullable<Text>,
493 public_key -> Nullable<Text>,
494 last_refreshed_at -> Timestamp,
495 banner -> Nullable<Text>,
504 preferred_username -> Nullable<Varchar>,
505 password_encrypted -> Text,
506 email -> Nullable<Text>,
507 avatar -> Nullable<Text>,
510 published -> Timestamp,
511 updated -> Nullable<Timestamp>,
514 default_sort_type -> Int2,
515 default_listing_type -> Int2,
517 show_avatars -> Bool,
518 send_notifications_to_email -> Bool,
519 matrix_user_id -> Nullable<Text>,
521 bio -> Nullable<Text>,
523 private_key -> Nullable<Text>,
524 public_key -> Nullable<Text>,
525 last_refreshed_at -> Timestamp,
526 banner -> Nullable<Text>,
531 joinable!(comment_alias_1 -> user_alias_1 (creator_id));
532 joinable!(comment -> comment_alias_1 (parent_id));
533 joinable!(user_mention -> user_alias_1 (recipient_id));
534 joinable!(post -> user_alias_1 (creator_id));
535 joinable!(comment -> user_alias_1 (creator_id));
537 joinable!(post_report -> user_alias_2 (resolver_id));
538 joinable!(comment_report -> user_alias_2 (resolver_id));
540 joinable!(comment -> post (post_id));
541 joinable!(comment -> user_ (creator_id));
542 joinable!(comment_aggregates -> comment (comment_id));
543 joinable!(comment_like -> comment (comment_id));
544 joinable!(comment_like -> post (post_id));
545 joinable!(comment_like -> user_ (user_id));
546 joinable!(comment_report -> comment (comment_id));
547 joinable!(comment_saved -> comment (comment_id));
548 joinable!(comment_saved -> user_ (user_id));
549 joinable!(community -> category (category_id));
550 joinable!(community -> user_ (creator_id));
551 joinable!(community_aggregates -> community (community_id));
552 joinable!(community_follower -> community (community_id));
553 joinable!(community_follower -> user_ (user_id));
554 joinable!(community_moderator -> community (community_id));
555 joinable!(community_moderator -> user_ (user_id));
556 joinable!(community_user_ban -> community (community_id));
557 joinable!(community_user_ban -> user_ (user_id));
558 joinable!(mod_add_community -> community (community_id));
559 joinable!(mod_ban_from_community -> community (community_id));
560 joinable!(mod_lock_post -> post (post_id));
561 joinable!(mod_lock_post -> user_ (mod_user_id));
562 joinable!(mod_remove_comment -> comment (comment_id));
563 joinable!(mod_remove_comment -> user_ (mod_user_id));
564 joinable!(mod_remove_community -> community (community_id));
565 joinable!(mod_remove_community -> user_ (mod_user_id));
566 joinable!(mod_remove_post -> post (post_id));
567 joinable!(mod_remove_post -> user_ (mod_user_id));
568 joinable!(mod_sticky_post -> post (post_id));
569 joinable!(mod_sticky_post -> user_ (mod_user_id));
570 joinable!(password_reset_request -> user_ (user_id));
571 joinable!(post -> community (community_id));
572 joinable!(post -> user_ (creator_id));
573 joinable!(post_aggregates -> post (post_id));
574 joinable!(post_like -> post (post_id));
575 joinable!(post_like -> user_ (user_id));
576 joinable!(post_read -> post (post_id));
577 joinable!(post_read -> user_ (user_id));
578 joinable!(post_report -> post (post_id));
579 joinable!(post_saved -> post (post_id));
580 joinable!(post_saved -> user_ (user_id));
581 joinable!(site -> user_ (creator_id));
582 joinable!(site_aggregates -> site (site_id));
583 joinable!(user_aggregates -> user_ (user_id));
584 joinable!(user_ban -> user_ (user_id));
585 joinable!(user_mention -> comment (comment_id));
586 joinable!(user_mention -> user_ (recipient_id));
588 allow_tables_to_appear_in_same_query!(
597 community_aggregates,
604 mod_ban_from_community,
607 mod_remove_community,
610 password_reset_request,