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,
113 users_active_day -> Int8,
114 users_active_week -> Int8,
115 users_active_month -> Int8,
116 users_active_half_year -> Int8,
121 community_follower (id) {
123 community_id -> Int4,
125 published -> Timestamp,
126 pending -> Nullable<Bool>,
131 community_moderator (id) {
133 community_id -> Int4,
135 published -> Timestamp,
140 community_user_ban (id) {
142 community_id -> Int4,
144 published -> Timestamp,
152 other_user_id -> Int4,
153 removed -> Nullable<Bool>,
159 mod_add_community (id) {
162 other_user_id -> Int4,
163 community_id -> Int4,
164 removed -> Nullable<Bool>,
173 other_user_id -> Int4,
174 reason -> Nullable<Text>,
175 banned -> Nullable<Bool>,
176 expires -> Nullable<Timestamp>,
182 mod_ban_from_community (id) {
185 other_user_id -> Int4,
186 community_id -> Int4,
187 reason -> Nullable<Text>,
188 banned -> Nullable<Bool>,
189 expires -> Nullable<Timestamp>,
199 locked -> Nullable<Bool>,
205 mod_remove_comment (id) {
209 reason -> Nullable<Text>,
210 removed -> Nullable<Bool>,
216 mod_remove_community (id) {
219 community_id -> Int4,
220 reason -> Nullable<Text>,
221 removed -> Nullable<Bool>,
222 expires -> Nullable<Timestamp>,
228 mod_remove_post (id) {
232 reason -> Nullable<Text>,
233 removed -> Nullable<Bool>,
239 mod_sticky_post (id) {
243 stickied -> Nullable<Bool>,
249 password_reset_request (id) {
252 token_encrypted -> Text,
253 published -> Timestamp,
261 url -> Nullable<Text>,
262 body -> Nullable<Text>,
264 community_id -> Int4,
267 published -> Timestamp,
268 updated -> Nullable<Timestamp>,
272 embed_title -> Nullable<Text>,
273 embed_description -> Nullable<Text>,
274 embed_html -> Nullable<Text>,
275 thumbnail_url -> Nullable<Text>,
282 post_aggregates (id) {
290 published -> Timestamp,
291 newest_comment_time -> Timestamp,
301 published -> Timestamp,
310 published -> Timestamp,
319 original_post_name -> Varchar,
320 original_post_url -> Nullable<Text>,
321 original_post_body -> Nullable<Text>,
324 resolver_id -> Nullable<Int4>,
325 published -> Timestamp,
326 updated -> Nullable<Timestamp>,
335 published -> Timestamp,
340 private_message (id) {
343 recipient_id -> Int4,
347 published -> Timestamp,
348 updated -> Nullable<Timestamp>,
358 description -> Nullable<Text>,
360 published -> Timestamp,
361 updated -> Nullable<Timestamp>,
362 enable_downvotes -> Bool,
363 open_registration -> Bool,
365 icon -> Nullable<Text>,
366 banner -> Nullable<Text>,
371 site_aggregates (id) {
378 users_active_day -> Int8,
379 users_active_week -> Int8,
380 users_active_month -> Int8,
381 users_active_half_year -> Int8,
389 preferred_username -> Nullable<Varchar>,
390 password_encrypted -> Text,
391 email -> Nullable<Text>,
392 avatar -> Nullable<Text>,
395 published -> Timestamp,
396 updated -> Nullable<Timestamp>,
399 default_sort_type -> Int2,
400 default_listing_type -> Int2,
402 show_avatars -> Bool,
403 send_notifications_to_email -> Bool,
404 matrix_user_id -> Nullable<Text>,
406 bio -> Nullable<Text>,
408 private_key -> Nullable<Text>,
409 public_key -> Nullable<Text>,
410 last_refreshed_at -> Timestamp,
411 banner -> Nullable<Text>,
417 user_aggregates (id) {
422 comment_count -> Int8,
423 comment_score -> Int8,
431 published -> Timestamp,
438 recipient_id -> Int4,
441 published -> Timestamp,
445 // These are necessary since diesel doesn't have self joins / aliases
447 comment_alias_1 (id) {
451 parent_id -> Nullable<Int4>,
455 published -> Timestamp,
456 updated -> Nullable<Timestamp>,
467 preferred_username -> Nullable<Varchar>,
468 password_encrypted -> Text,
469 email -> Nullable<Text>,
470 avatar -> Nullable<Text>,
473 published -> Timestamp,
474 updated -> Nullable<Timestamp>,
477 default_sort_type -> Int2,
478 default_listing_type -> Int2,
480 show_avatars -> Bool,
481 send_notifications_to_email -> Bool,
482 matrix_user_id -> Nullable<Text>,
484 bio -> Nullable<Text>,
486 private_key -> Nullable<Text>,
487 public_key -> Nullable<Text>,
488 last_refreshed_at -> Timestamp,
489 banner -> Nullable<Text>,
498 preferred_username -> Nullable<Varchar>,
499 password_encrypted -> Text,
500 email -> Nullable<Text>,
501 avatar -> Nullable<Text>,
504 published -> Timestamp,
505 updated -> Nullable<Timestamp>,
508 default_sort_type -> Int2,
509 default_listing_type -> Int2,
511 show_avatars -> Bool,
512 send_notifications_to_email -> Bool,
513 matrix_user_id -> Nullable<Text>,
515 bio -> Nullable<Text>,
517 private_key -> Nullable<Text>,
518 public_key -> Nullable<Text>,
519 last_refreshed_at -> Timestamp,
520 banner -> Nullable<Text>,
525 joinable!(comment_alias_1 -> user_alias_1 (creator_id));
526 joinable!(comment -> comment_alias_1 (parent_id));
527 joinable!(user_mention -> user_alias_1 (recipient_id));
528 joinable!(post -> user_alias_1 (creator_id));
529 joinable!(comment -> user_alias_1 (creator_id));
531 joinable!(post_report -> user_alias_2 (resolver_id));
532 joinable!(comment_report -> user_alias_2 (resolver_id));
534 joinable!(comment -> post (post_id));
535 joinable!(comment -> user_ (creator_id));
536 joinable!(comment_aggregates -> comment (comment_id));
537 joinable!(comment_like -> comment (comment_id));
538 joinable!(comment_like -> post (post_id));
539 joinable!(comment_like -> user_ (user_id));
540 joinable!(comment_report -> comment (comment_id));
541 joinable!(comment_saved -> comment (comment_id));
542 joinable!(comment_saved -> user_ (user_id));
543 joinable!(community -> category (category_id));
544 joinable!(community -> user_ (creator_id));
545 joinable!(community_aggregates -> community (community_id));
546 joinable!(community_follower -> community (community_id));
547 joinable!(community_follower -> user_ (user_id));
548 joinable!(community_moderator -> community (community_id));
549 joinable!(community_moderator -> user_ (user_id));
550 joinable!(community_user_ban -> community (community_id));
551 joinable!(community_user_ban -> user_ (user_id));
552 joinable!(mod_add_community -> community (community_id));
553 joinable!(mod_ban_from_community -> community (community_id));
554 joinable!(mod_lock_post -> post (post_id));
555 joinable!(mod_lock_post -> user_ (mod_user_id));
556 joinable!(mod_remove_comment -> comment (comment_id));
557 joinable!(mod_remove_comment -> user_ (mod_user_id));
558 joinable!(mod_remove_community -> community (community_id));
559 joinable!(mod_remove_community -> user_ (mod_user_id));
560 joinable!(mod_remove_post -> post (post_id));
561 joinable!(mod_remove_post -> user_ (mod_user_id));
562 joinable!(mod_sticky_post -> post (post_id));
563 joinable!(mod_sticky_post -> user_ (mod_user_id));
564 joinable!(password_reset_request -> user_ (user_id));
565 joinable!(post -> community (community_id));
566 joinable!(post -> user_ (creator_id));
567 joinable!(post_aggregates -> post (post_id));
568 joinable!(post_like -> post (post_id));
569 joinable!(post_like -> user_ (user_id));
570 joinable!(post_read -> post (post_id));
571 joinable!(post_read -> user_ (user_id));
572 joinable!(post_report -> post (post_id));
573 joinable!(post_saved -> post (post_id));
574 joinable!(post_saved -> user_ (user_id));
575 joinable!(site -> user_ (creator_id));
576 joinable!(site_aggregates -> site (site_id));
577 joinable!(user_aggregates -> user_ (user_id));
578 joinable!(user_ban -> user_ (user_id));
579 joinable!(user_mention -> comment (comment_id));
580 joinable!(user_mention -> user_ (recipient_id));
582 allow_tables_to_appear_in_same_query!(
591 community_aggregates,
598 mod_ban_from_community,
601 mod_remove_community,
604 password_reset_request,