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>,
106 community_aggregates (id) {
108 community_id -> Int4,
112 published -> Timestamp,
117 community_follower (id) {
119 community_id -> Int4,
121 published -> Timestamp,
122 pending -> Nullable<Bool>,
127 community_moderator (id) {
129 community_id -> Int4,
131 published -> Timestamp,
136 community_user_ban (id) {
138 community_id -> Int4,
140 published -> Timestamp,
148 other_user_id -> Int4,
149 removed -> Nullable<Bool>,
155 mod_add_community (id) {
158 other_user_id -> Int4,
159 community_id -> Int4,
160 removed -> Nullable<Bool>,
169 other_user_id -> Int4,
170 reason -> Nullable<Text>,
171 banned -> Nullable<Bool>,
172 expires -> Nullable<Timestamp>,
178 mod_ban_from_community (id) {
181 other_user_id -> Int4,
182 community_id -> Int4,
183 reason -> Nullable<Text>,
184 banned -> Nullable<Bool>,
185 expires -> Nullable<Timestamp>,
195 locked -> Nullable<Bool>,
201 mod_remove_comment (id) {
205 reason -> Nullable<Text>,
206 removed -> Nullable<Bool>,
212 mod_remove_community (id) {
215 community_id -> Int4,
216 reason -> Nullable<Text>,
217 removed -> Nullable<Bool>,
218 expires -> Nullable<Timestamp>,
224 mod_remove_post (id) {
228 reason -> Nullable<Text>,
229 removed -> Nullable<Bool>,
235 mod_sticky_post (id) {
239 stickied -> Nullable<Bool>,
245 password_reset_request (id) {
248 token_encrypted -> Text,
249 published -> Timestamp,
257 url -> Nullable<Text>,
258 body -> Nullable<Text>,
260 community_id -> Int4,
263 published -> Timestamp,
264 updated -> Nullable<Timestamp>,
268 embed_title -> Nullable<Text>,
269 embed_description -> Nullable<Text>,
270 embed_html -> Nullable<Text>,
271 thumbnail_url -> Nullable<Text>,
278 post_aggregates (id) {
285 published -> Timestamp,
286 newest_comment_time -> Timestamp,
296 published -> Timestamp,
305 published -> Timestamp,
314 original_post_name -> Varchar,
315 original_post_url -> Nullable<Text>,
316 original_post_body -> Nullable<Text>,
319 resolver_id -> Nullable<Int4>,
320 published -> Timestamp,
321 updated -> Nullable<Timestamp>,
330 published -> Timestamp,
335 private_message (id) {
338 recipient_id -> Int4,
342 published -> Timestamp,
343 updated -> Nullable<Timestamp>,
353 description -> Nullable<Text>,
355 published -> Timestamp,
356 updated -> Nullable<Timestamp>,
357 enable_downvotes -> Bool,
358 open_registration -> Bool,
360 icon -> Nullable<Text>,
361 banner -> Nullable<Text>,
366 site_aggregates (id) {
380 preferred_username -> Nullable<Varchar>,
381 password_encrypted -> Text,
382 email -> Nullable<Text>,
383 avatar -> Nullable<Text>,
386 published -> Timestamp,
387 updated -> Nullable<Timestamp>,
390 default_sort_type -> Int2,
391 default_listing_type -> Int2,
393 show_avatars -> Bool,
394 send_notifications_to_email -> Bool,
395 matrix_user_id -> Nullable<Text>,
397 bio -> Nullable<Text>,
399 private_key -> Nullable<Text>,
400 public_key -> Nullable<Text>,
401 last_refreshed_at -> Timestamp,
402 banner -> Nullable<Text>,
408 user_aggregates (id) {
413 comment_count -> Int8,
414 comment_score -> Int8,
422 published -> Timestamp,
429 recipient_id -> Int4,
432 published -> Timestamp,
436 // These are necessary since diesel doesn't have self joins / aliases
438 comment_alias_1 (id) {
442 parent_id -> Nullable<Int4>,
446 published -> Timestamp,
447 updated -> Nullable<Timestamp>,
458 preferred_username -> Nullable<Varchar>,
459 password_encrypted -> Text,
460 email -> Nullable<Text>,
461 avatar -> Nullable<Text>,
464 published -> Timestamp,
465 updated -> Nullable<Timestamp>,
468 default_sort_type -> Int2,
469 default_listing_type -> Int2,
471 show_avatars -> Bool,
472 send_notifications_to_email -> Bool,
473 matrix_user_id -> Nullable<Text>,
475 bio -> Nullable<Text>,
477 private_key -> Nullable<Text>,
478 public_key -> Nullable<Text>,
479 last_refreshed_at -> Timestamp,
480 banner -> Nullable<Text>,
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>,
516 joinable!(comment_alias_1 -> user_alias_1 (creator_id));
517 joinable!(comment -> comment_alias_1 (parent_id));
518 joinable!(user_mention -> user_alias_1 (recipient_id));
519 joinable!(post -> user_alias_1 (creator_id));
520 joinable!(comment -> user_alias_1 (creator_id));
522 joinable!(post_report -> user_alias_2 (resolver_id));
523 joinable!(comment_report -> user_alias_2 (resolver_id));
525 joinable!(comment -> post (post_id));
526 joinable!(comment -> user_ (creator_id));
527 joinable!(comment_aggregates -> comment (comment_id));
528 joinable!(comment_like -> comment (comment_id));
529 joinable!(comment_like -> post (post_id));
530 joinable!(comment_like -> user_ (user_id));
531 joinable!(comment_report -> comment (comment_id));
532 joinable!(comment_saved -> comment (comment_id));
533 joinable!(comment_saved -> user_ (user_id));
534 joinable!(community -> category (category_id));
535 joinable!(community -> user_ (creator_id));
536 joinable!(community_aggregates -> community (community_id));
537 joinable!(community_follower -> community (community_id));
538 joinable!(community_follower -> user_ (user_id));
539 joinable!(community_moderator -> community (community_id));
540 joinable!(community_moderator -> user_ (user_id));
541 joinable!(community_user_ban -> community (community_id));
542 joinable!(community_user_ban -> user_ (user_id));
543 joinable!(mod_add_community -> community (community_id));
544 joinable!(mod_ban_from_community -> community (community_id));
545 joinable!(mod_lock_post -> post (post_id));
546 joinable!(mod_lock_post -> user_ (mod_user_id));
547 joinable!(mod_remove_comment -> comment (comment_id));
548 joinable!(mod_remove_comment -> user_ (mod_user_id));
549 joinable!(mod_remove_community -> community (community_id));
550 joinable!(mod_remove_community -> user_ (mod_user_id));
551 joinable!(mod_remove_post -> post (post_id));
552 joinable!(mod_remove_post -> user_ (mod_user_id));
553 joinable!(mod_sticky_post -> post (post_id));
554 joinable!(mod_sticky_post -> user_ (mod_user_id));
555 joinable!(password_reset_request -> user_ (user_id));
556 joinable!(post -> community (community_id));
557 joinable!(post -> user_ (creator_id));
558 joinable!(post_aggregates -> post (post_id));
559 joinable!(post_like -> post (post_id));
560 joinable!(post_like -> user_ (user_id));
561 joinable!(post_read -> post (post_id));
562 joinable!(post_read -> user_ (user_id));
563 joinable!(post_report -> post (post_id));
564 joinable!(post_saved -> post (post_id));
565 joinable!(post_saved -> user_ (user_id));
566 joinable!(site -> user_ (creator_id));
567 joinable!(site_aggregates -> site (site_id));
568 joinable!(user_aggregates -> user_ (user_id));
569 joinable!(user_ban -> user_ (user_id));
570 joinable!(user_mention -> comment (comment_id));
571 joinable!(user_mention -> user_ (recipient_id));
573 allow_tables_to_appear_in_same_query!(
582 community_aggregates,
589 mod_ban_from_community,
592 mod_remove_community,
595 password_reset_request,