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) {
54 published -> Timestamp,
63 original_comment_text -> Text,
66 resolver_id -> Nullable<Int4>,
67 published -> Timestamp,
68 updated -> Nullable<Timestamp>,
77 published -> Timestamp,
86 description -> Nullable<Text>,
90 published -> Timestamp,
91 updated -> Nullable<Timestamp>,
96 private_key -> Nullable<Text>,
97 public_key -> Nullable<Text>,
98 last_refreshed_at -> Timestamp,
99 icon -> Nullable<Text>,
100 banner -> Nullable<Text>,
105 community_aggregates (id) {
107 community_id -> Int4,
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_user_ban (id) {
136 community_id -> Int4,
138 published -> Timestamp,
146 other_user_id -> Int4,
147 removed -> Nullable<Bool>,
153 mod_add_community (id) {
156 other_user_id -> Int4,
157 community_id -> Int4,
158 removed -> Nullable<Bool>,
167 other_user_id -> Int4,
168 reason -> Nullable<Text>,
169 banned -> Nullable<Bool>,
170 expires -> Nullable<Timestamp>,
176 mod_ban_from_community (id) {
179 other_user_id -> Int4,
180 community_id -> Int4,
181 reason -> Nullable<Text>,
182 banned -> Nullable<Bool>,
183 expires -> Nullable<Timestamp>,
193 locked -> Nullable<Bool>,
199 mod_remove_comment (id) {
203 reason -> Nullable<Text>,
204 removed -> Nullable<Bool>,
210 mod_remove_community (id) {
213 community_id -> Int4,
214 reason -> Nullable<Text>,
215 removed -> Nullable<Bool>,
216 expires -> Nullable<Timestamp>,
222 mod_remove_post (id) {
226 reason -> Nullable<Text>,
227 removed -> Nullable<Bool>,
233 mod_sticky_post (id) {
237 stickied -> Nullable<Bool>,
243 password_reset_request (id) {
246 token_encrypted -> Text,
247 published -> Timestamp,
255 url -> Nullable<Text>,
256 body -> Nullable<Text>,
258 community_id -> Int4,
261 published -> Timestamp,
262 updated -> Nullable<Timestamp>,
266 embed_title -> Nullable<Text>,
267 embed_description -> Nullable<Text>,
268 embed_html -> Nullable<Text>,
269 thumbnail_url -> Nullable<Text>,
276 post_aggregates (id) {
283 newest_comment_time -> Timestamp,
293 published -> Timestamp,
302 published -> Timestamp,
311 original_post_name -> Varchar,
312 original_post_url -> Nullable<Text>,
313 original_post_body -> Nullable<Text>,
316 resolver_id -> Nullable<Int4>,
317 published -> Timestamp,
318 updated -> Nullable<Timestamp>,
327 published -> Timestamp,
332 private_message (id) {
335 recipient_id -> Int4,
339 published -> Timestamp,
340 updated -> Nullable<Timestamp>,
350 description -> Nullable<Text>,
352 published -> Timestamp,
353 updated -> Nullable<Timestamp>,
354 enable_downvotes -> Bool,
355 open_registration -> Bool,
357 icon -> Nullable<Text>,
358 banner -> Nullable<Text>,
363 site_aggregates (id) {
377 preferred_username -> Nullable<Varchar>,
378 password_encrypted -> Text,
379 email -> Nullable<Text>,
380 avatar -> Nullable<Text>,
383 published -> Timestamp,
384 updated -> Nullable<Timestamp>,
387 default_sort_type -> Int2,
388 default_listing_type -> Int2,
390 show_avatars -> Bool,
391 send_notifications_to_email -> Bool,
392 matrix_user_id -> Nullable<Text>,
394 bio -> Nullable<Text>,
396 private_key -> Nullable<Text>,
397 public_key -> Nullable<Text>,
398 last_refreshed_at -> Timestamp,
399 banner -> Nullable<Text>,
405 user_aggregates (id) {
410 comment_count -> Int8,
411 comment_score -> Int8,
419 published -> Timestamp,
426 recipient_id -> Int4,
429 published -> Timestamp,
433 // These are necessary since diesel doesn't have self joins / aliases
435 comment_alias_1 (id) {
439 parent_id -> Nullable<Int4>,
443 published -> Timestamp,
444 updated -> Nullable<Timestamp>,
455 preferred_username -> Nullable<Varchar>,
456 password_encrypted -> Text,
457 email -> Nullable<Text>,
458 avatar -> Nullable<Text>,
461 published -> Timestamp,
462 updated -> Nullable<Timestamp>,
465 default_sort_type -> Int2,
466 default_listing_type -> Int2,
468 show_avatars -> Bool,
469 send_notifications_to_email -> Bool,
470 matrix_user_id -> Nullable<Text>,
472 bio -> Nullable<Text>,
474 private_key -> Nullable<Text>,
475 public_key -> Nullable<Text>,
476 last_refreshed_at -> Timestamp,
477 banner -> Nullable<Text>,
486 preferred_username -> Nullable<Varchar>,
487 password_encrypted -> Text,
488 email -> Nullable<Text>,
489 avatar -> Nullable<Text>,
492 published -> Timestamp,
493 updated -> Nullable<Timestamp>,
496 default_sort_type -> Int2,
497 default_listing_type -> Int2,
499 show_avatars -> Bool,
500 send_notifications_to_email -> Bool,
501 matrix_user_id -> Nullable<Text>,
503 bio -> Nullable<Text>,
505 private_key -> Nullable<Text>,
506 public_key -> Nullable<Text>,
507 last_refreshed_at -> Timestamp,
508 banner -> Nullable<Text>,
513 joinable!(comment_alias_1 -> user_alias_1 (creator_id));
514 joinable!(comment -> comment_alias_1 (parent_id));
515 joinable!(user_mention -> user_alias_1 (recipient_id));
516 joinable!(post -> user_alias_1 (creator_id));
517 joinable!(comment -> user_alias_1 (creator_id));
519 joinable!(post_report -> user_alias_2 (resolver_id));
520 joinable!(comment_report -> user_alias_2 (resolver_id));
522 joinable!(comment -> post (post_id));
523 joinable!(comment -> user_ (creator_id));
524 joinable!(comment_aggregates -> comment (comment_id));
525 joinable!(comment_like -> comment (comment_id));
526 joinable!(comment_like -> post (post_id));
527 joinable!(comment_like -> user_ (user_id));
528 joinable!(comment_report -> comment (comment_id));
529 joinable!(comment_saved -> comment (comment_id));
530 joinable!(comment_saved -> user_ (user_id));
531 joinable!(community -> category (category_id));
532 joinable!(community -> user_ (creator_id));
533 joinable!(community_aggregates -> community (community_id));
534 joinable!(community_follower -> community (community_id));
535 joinable!(community_follower -> user_ (user_id));
536 joinable!(community_moderator -> community (community_id));
537 joinable!(community_moderator -> user_ (user_id));
538 joinable!(community_user_ban -> community (community_id));
539 joinable!(community_user_ban -> user_ (user_id));
540 joinable!(mod_add_community -> community (community_id));
541 joinable!(mod_ban_from_community -> community (community_id));
542 joinable!(mod_lock_post -> post (post_id));
543 joinable!(mod_lock_post -> user_ (mod_user_id));
544 joinable!(mod_remove_comment -> comment (comment_id));
545 joinable!(mod_remove_comment -> user_ (mod_user_id));
546 joinable!(mod_remove_community -> community (community_id));
547 joinable!(mod_remove_community -> user_ (mod_user_id));
548 joinable!(mod_remove_post -> post (post_id));
549 joinable!(mod_remove_post -> user_ (mod_user_id));
550 joinable!(mod_sticky_post -> post (post_id));
551 joinable!(mod_sticky_post -> user_ (mod_user_id));
552 joinable!(password_reset_request -> user_ (user_id));
553 joinable!(post -> community (community_id));
554 joinable!(post -> user_ (creator_id));
555 joinable!(post_aggregates -> post (post_id));
556 joinable!(post_like -> post (post_id));
557 joinable!(post_like -> user_ (user_id));
558 joinable!(post_read -> post (post_id));
559 joinable!(post_read -> user_ (user_id));
560 joinable!(post_report -> post (post_id));
561 joinable!(post_saved -> post (post_id));
562 joinable!(post_saved -> user_ (user_id));
563 joinable!(site -> user_ (creator_id));
564 joinable!(site_aggregates -> site (site_id));
565 joinable!(user_aggregates -> user_ (user_id));
566 joinable!(user_ban -> user_ (user_id));
567 joinable!(user_mention -> comment (comment_id));
568 joinable!(user_mention -> user_ (recipient_id));
570 allow_tables_to_appear_in_same_query!(
579 community_aggregates,
586 mod_ban_from_community,
589 mod_remove_community,
592 password_reset_request,