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>,
83 published -> Timestamp,
84 updated -> Nullable<Timestamp>,
89 private_key -> Nullable<Text>,
90 public_key -> Nullable<Text>,
91 last_refreshed_at -> Timestamp,
92 icon -> Nullable<Text>,
93 banner -> Nullable<Text>,
94 followers_url -> Text,
96 shared_inbox_url -> Nullable<Text>,
101 community_aggregates (id) {
103 community_id -> Int4,
107 published -> Timestamp,
108 users_active_day -> Int8,
109 users_active_week -> Int8,
110 users_active_month -> Int8,
111 users_active_half_year -> Int8,
116 community_follower (id) {
118 community_id -> Int4,
120 published -> Timestamp,
121 pending -> Nullable<Bool>,
126 community_moderator (id) {
128 community_id -> Int4,
130 published -> Timestamp,
135 community_user_ban (id) {
137 community_id -> Int4,
139 published -> Timestamp,
147 other_user_id -> Int4,
148 removed -> Nullable<Bool>,
154 mod_add_community (id) {
157 other_user_id -> Int4,
158 community_id -> Int4,
159 removed -> Nullable<Bool>,
168 other_user_id -> Int4,
169 reason -> Nullable<Text>,
170 banned -> Nullable<Bool>,
171 expires -> Nullable<Timestamp>,
177 mod_ban_from_community (id) {
180 other_user_id -> Int4,
181 community_id -> Int4,
182 reason -> Nullable<Text>,
183 banned -> Nullable<Bool>,
184 expires -> Nullable<Timestamp>,
194 locked -> Nullable<Bool>,
200 mod_remove_comment (id) {
204 reason -> Nullable<Text>,
205 removed -> Nullable<Bool>,
211 mod_remove_community (id) {
214 community_id -> Int4,
215 reason -> Nullable<Text>,
216 removed -> Nullable<Bool>,
217 expires -> Nullable<Timestamp>,
223 mod_remove_post (id) {
227 reason -> Nullable<Text>,
228 removed -> Nullable<Bool>,
234 mod_sticky_post (id) {
238 stickied -> Nullable<Bool>,
244 password_reset_request (id) {
247 token_encrypted -> Text,
248 published -> Timestamp,
256 url -> Nullable<Text>,
257 body -> Nullable<Text>,
259 community_id -> Int4,
262 published -> Timestamp,
263 updated -> Nullable<Timestamp>,
267 embed_title -> Nullable<Text>,
268 embed_description -> Nullable<Text>,
269 embed_html -> Nullable<Text>,
270 thumbnail_url -> Nullable<Text>,
277 post_aggregates (id) {
285 published -> Timestamp,
286 newest_comment_time_necro -> Timestamp,
287 newest_comment_time -> Timestamp,
297 published -> Timestamp,
306 published -> Timestamp,
315 original_post_name -> Varchar,
316 original_post_url -> Nullable<Text>,
317 original_post_body -> Nullable<Text>,
320 resolver_id -> Nullable<Int4>,
321 published -> Timestamp,
322 updated -> Nullable<Timestamp>,
331 published -> Timestamp,
336 private_message (id) {
339 recipient_id -> Int4,
343 published -> Timestamp,
344 updated -> Nullable<Timestamp>,
354 description -> Nullable<Text>,
356 published -> Timestamp,
357 updated -> Nullable<Timestamp>,
358 enable_downvotes -> Bool,
359 open_registration -> Bool,
361 icon -> Nullable<Text>,
362 banner -> Nullable<Text>,
367 site_aggregates (id) {
374 users_active_day -> Int8,
375 users_active_week -> Int8,
376 users_active_month -> Int8,
377 users_active_half_year -> Int8,
385 preferred_username -> Nullable<Varchar>,
386 password_encrypted -> Text,
387 email -> Nullable<Text>,
388 avatar -> Nullable<Text>,
391 published -> Timestamp,
392 updated -> Nullable<Timestamp>,
395 default_sort_type -> Int2,
396 default_listing_type -> Int2,
398 show_avatars -> Bool,
399 send_notifications_to_email -> Bool,
400 matrix_user_id -> Nullable<Text>,
402 bio -> Nullable<Text>,
404 private_key -> Nullable<Text>,
405 public_key -> Nullable<Text>,
406 last_refreshed_at -> Timestamp,
407 banner -> Nullable<Text>,
410 shared_inbox_url -> Nullable<Text>,
411 validator_time -> Timestamp,
416 user_aggregates (id) {
421 comment_count -> Int8,
422 comment_score -> Int8,
430 published -> Timestamp,
437 recipient_id -> Int4,
440 published -> Timestamp,
444 // These are necessary since diesel doesn't have self joins / aliases
446 comment_alias_1 (id) {
450 parent_id -> Nullable<Int4>,
454 published -> Timestamp,
455 updated -> Nullable<Timestamp>,
466 preferred_username -> Nullable<Varchar>,
467 password_encrypted -> Text,
468 email -> Nullable<Text>,
469 avatar -> Nullable<Text>,
472 published -> Timestamp,
473 updated -> Nullable<Timestamp>,
476 default_sort_type -> Int2,
477 default_listing_type -> Int2,
479 show_avatars -> Bool,
480 send_notifications_to_email -> Bool,
481 matrix_user_id -> Nullable<Text>,
483 bio -> Nullable<Text>,
485 private_key -> Nullable<Text>,
486 public_key -> Nullable<Text>,
487 last_refreshed_at -> Timestamp,
488 banner -> Nullable<Text>,
497 preferred_username -> Nullable<Varchar>,
498 password_encrypted -> Text,
499 email -> Nullable<Text>,
500 avatar -> Nullable<Text>,
503 published -> Timestamp,
504 updated -> Nullable<Timestamp>,
507 default_sort_type -> Int2,
508 default_listing_type -> Int2,
510 show_avatars -> Bool,
511 send_notifications_to_email -> Bool,
512 matrix_user_id -> Nullable<Text>,
514 bio -> Nullable<Text>,
516 private_key -> Nullable<Text>,
517 public_key -> Nullable<Text>,
518 last_refreshed_at -> Timestamp,
519 banner -> Nullable<Text>,
524 joinable!(comment_alias_1 -> user_alias_1 (creator_id));
525 joinable!(comment -> comment_alias_1 (parent_id));
526 joinable!(user_mention -> user_alias_1 (recipient_id));
527 joinable!(post -> user_alias_1 (creator_id));
528 joinable!(comment -> user_alias_1 (creator_id));
530 joinable!(post_report -> user_alias_2 (resolver_id));
531 joinable!(comment_report -> user_alias_2 (resolver_id));
533 joinable!(comment -> post (post_id));
534 joinable!(comment -> user_ (creator_id));
535 joinable!(comment_aggregates -> comment (comment_id));
536 joinable!(comment_like -> comment (comment_id));
537 joinable!(comment_like -> post (post_id));
538 joinable!(comment_like -> user_ (user_id));
539 joinable!(comment_report -> comment (comment_id));
540 joinable!(comment_saved -> comment (comment_id));
541 joinable!(comment_saved -> user_ (user_id));
542 joinable!(community -> user_ (creator_id));
543 joinable!(community_aggregates -> community (community_id));
544 joinable!(community_follower -> community (community_id));
545 joinable!(community_follower -> user_ (user_id));
546 joinable!(community_moderator -> community (community_id));
547 joinable!(community_moderator -> user_ (user_id));
548 joinable!(community_user_ban -> community (community_id));
549 joinable!(community_user_ban -> user_ (user_id));
550 joinable!(mod_add_community -> community (community_id));
551 joinable!(mod_ban_from_community -> community (community_id));
552 joinable!(mod_lock_post -> post (post_id));
553 joinable!(mod_lock_post -> user_ (mod_user_id));
554 joinable!(mod_remove_comment -> comment (comment_id));
555 joinable!(mod_remove_comment -> user_ (mod_user_id));
556 joinable!(mod_remove_community -> community (community_id));
557 joinable!(mod_remove_community -> user_ (mod_user_id));
558 joinable!(mod_remove_post -> post (post_id));
559 joinable!(mod_remove_post -> user_ (mod_user_id));
560 joinable!(mod_sticky_post -> post (post_id));
561 joinable!(mod_sticky_post -> user_ (mod_user_id));
562 joinable!(password_reset_request -> user_ (user_id));
563 joinable!(post -> community (community_id));
564 joinable!(post -> user_ (creator_id));
565 joinable!(post_aggregates -> post (post_id));
566 joinable!(post_like -> post (post_id));
567 joinable!(post_like -> user_ (user_id));
568 joinable!(post_read -> post (post_id));
569 joinable!(post_read -> user_ (user_id));
570 joinable!(post_report -> post (post_id));
571 joinable!(post_saved -> post (post_id));
572 joinable!(post_saved -> user_ (user_id));
573 joinable!(site -> user_ (creator_id));
574 joinable!(site_aggregates -> site (site_id));
575 joinable!(user_aggregates -> user_ (user_id));
576 joinable!(user_ban -> user_ (user_id));
577 joinable!(user_mention -> comment (comment_id));
578 joinable!(user_mention -> user_ (recipient_id));
580 allow_tables_to_appear_in_same_query!(
588 community_aggregates,
595 mod_ban_from_community,
598 mod_remove_community,
601 password_reset_request,