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>,
415 user_aggregates (id) {
420 comment_count -> Int8,
421 comment_score -> Int8,
429 published -> Timestamp,
436 recipient_id -> Int4,
439 published -> Timestamp,
443 // These are necessary since diesel doesn't have self joins / aliases
445 comment_alias_1 (id) {
449 parent_id -> Nullable<Int4>,
453 published -> Timestamp,
454 updated -> Nullable<Timestamp>,
465 preferred_username -> Nullable<Varchar>,
466 password_encrypted -> Text,
467 email -> Nullable<Text>,
468 avatar -> Nullable<Text>,
471 published -> Timestamp,
472 updated -> Nullable<Timestamp>,
475 default_sort_type -> Int2,
476 default_listing_type -> Int2,
478 show_avatars -> Bool,
479 send_notifications_to_email -> Bool,
480 matrix_user_id -> Nullable<Text>,
482 bio -> Nullable<Text>,
484 private_key -> Nullable<Text>,
485 public_key -> Nullable<Text>,
486 last_refreshed_at -> Timestamp,
487 banner -> Nullable<Text>,
496 preferred_username -> Nullable<Varchar>,
497 password_encrypted -> Text,
498 email -> Nullable<Text>,
499 avatar -> Nullable<Text>,
502 published -> Timestamp,
503 updated -> Nullable<Timestamp>,
506 default_sort_type -> Int2,
507 default_listing_type -> Int2,
509 show_avatars -> Bool,
510 send_notifications_to_email -> Bool,
511 matrix_user_id -> Nullable<Text>,
513 bio -> Nullable<Text>,
515 private_key -> Nullable<Text>,
516 public_key -> Nullable<Text>,
517 last_refreshed_at -> Timestamp,
518 banner -> Nullable<Text>,
523 joinable!(comment_alias_1 -> user_alias_1 (creator_id));
524 joinable!(comment -> comment_alias_1 (parent_id));
525 joinable!(user_mention -> user_alias_1 (recipient_id));
526 joinable!(post -> user_alias_1 (creator_id));
527 joinable!(comment -> user_alias_1 (creator_id));
529 joinable!(post_report -> user_alias_2 (resolver_id));
530 joinable!(comment_report -> user_alias_2 (resolver_id));
532 joinable!(comment -> post (post_id));
533 joinable!(comment -> user_ (creator_id));
534 joinable!(comment_aggregates -> comment (comment_id));
535 joinable!(comment_like -> comment (comment_id));
536 joinable!(comment_like -> post (post_id));
537 joinable!(comment_like -> user_ (user_id));
538 joinable!(comment_report -> comment (comment_id));
539 joinable!(comment_saved -> comment (comment_id));
540 joinable!(comment_saved -> user_ (user_id));
541 joinable!(community -> user_ (creator_id));
542 joinable!(community_aggregates -> community (community_id));
543 joinable!(community_follower -> community (community_id));
544 joinable!(community_follower -> user_ (user_id));
545 joinable!(community_moderator -> community (community_id));
546 joinable!(community_moderator -> user_ (user_id));
547 joinable!(community_user_ban -> community (community_id));
548 joinable!(community_user_ban -> user_ (user_id));
549 joinable!(mod_add_community -> community (community_id));
550 joinable!(mod_ban_from_community -> community (community_id));
551 joinable!(mod_lock_post -> post (post_id));
552 joinable!(mod_lock_post -> user_ (mod_user_id));
553 joinable!(mod_remove_comment -> comment (comment_id));
554 joinable!(mod_remove_comment -> user_ (mod_user_id));
555 joinable!(mod_remove_community -> community (community_id));
556 joinable!(mod_remove_community -> user_ (mod_user_id));
557 joinable!(mod_remove_post -> post (post_id));
558 joinable!(mod_remove_post -> user_ (mod_user_id));
559 joinable!(mod_sticky_post -> post (post_id));
560 joinable!(mod_sticky_post -> user_ (mod_user_id));
561 joinable!(password_reset_request -> user_ (user_id));
562 joinable!(post -> community (community_id));
563 joinable!(post -> user_ (creator_id));
564 joinable!(post_aggregates -> post (post_id));
565 joinable!(post_like -> post (post_id));
566 joinable!(post_like -> user_ (user_id));
567 joinable!(post_read -> post (post_id));
568 joinable!(post_read -> user_ (user_id));
569 joinable!(post_report -> post (post_id));
570 joinable!(post_saved -> post (post_id));
571 joinable!(post_saved -> user_ (user_id));
572 joinable!(site -> user_ (creator_id));
573 joinable!(site_aggregates -> site (site_id));
574 joinable!(user_aggregates -> user_ (user_id));
575 joinable!(user_ban -> user_ (user_id));
576 joinable!(user_mention -> comment (comment_id));
577 joinable!(user_mention -> user_ (recipient_id));
579 allow_tables_to_appear_in_same_query!(
587 community_aggregates,
594 mod_ban_from_community,
597 mod_remove_community,
600 password_reset_request,