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>,
102 followers_url -> Text,
104 shared_inbox_url -> Nullable<Text>,
109 community_aggregates (id) {
111 community_id -> Int4,
115 published -> Timestamp,
116 users_active_day -> Int8,
117 users_active_week -> Int8,
118 users_active_month -> Int8,
119 users_active_half_year -> Int8,
124 community_follower (id) {
126 community_id -> Int4,
128 published -> Timestamp,
129 pending -> Nullable<Bool>,
134 community_moderator (id) {
136 community_id -> Int4,
138 published -> Timestamp,
143 community_user_ban (id) {
145 community_id -> Int4,
147 published -> Timestamp,
155 other_user_id -> Int4,
156 removed -> Nullable<Bool>,
162 mod_add_community (id) {
165 other_user_id -> Int4,
166 community_id -> Int4,
167 removed -> Nullable<Bool>,
176 other_user_id -> Int4,
177 reason -> Nullable<Text>,
178 banned -> Nullable<Bool>,
179 expires -> Nullable<Timestamp>,
185 mod_ban_from_community (id) {
188 other_user_id -> Int4,
189 community_id -> Int4,
190 reason -> Nullable<Text>,
191 banned -> Nullable<Bool>,
192 expires -> Nullable<Timestamp>,
202 locked -> Nullable<Bool>,
208 mod_remove_comment (id) {
212 reason -> Nullable<Text>,
213 removed -> Nullable<Bool>,
219 mod_remove_community (id) {
222 community_id -> Int4,
223 reason -> Nullable<Text>,
224 removed -> Nullable<Bool>,
225 expires -> Nullable<Timestamp>,
231 mod_remove_post (id) {
235 reason -> Nullable<Text>,
236 removed -> Nullable<Bool>,
242 mod_sticky_post (id) {
246 stickied -> Nullable<Bool>,
252 password_reset_request (id) {
255 token_encrypted -> Text,
256 published -> Timestamp,
264 url -> Nullable<Text>,
265 body -> Nullable<Text>,
267 community_id -> Int4,
270 published -> Timestamp,
271 updated -> Nullable<Timestamp>,
275 embed_title -> Nullable<Text>,
276 embed_description -> Nullable<Text>,
277 embed_html -> Nullable<Text>,
278 thumbnail_url -> Nullable<Text>,
285 post_aggregates (id) {
293 published -> Timestamp,
294 newest_comment_time -> Timestamp,
304 published -> Timestamp,
313 published -> Timestamp,
322 original_post_name -> Varchar,
323 original_post_url -> Nullable<Text>,
324 original_post_body -> Nullable<Text>,
327 resolver_id -> Nullable<Int4>,
328 published -> Timestamp,
329 updated -> Nullable<Timestamp>,
338 published -> Timestamp,
343 private_message (id) {
346 recipient_id -> Int4,
350 published -> Timestamp,
351 updated -> Nullable<Timestamp>,
361 description -> Nullable<Text>,
363 published -> Timestamp,
364 updated -> Nullable<Timestamp>,
365 enable_downvotes -> Bool,
366 open_registration -> Bool,
368 icon -> Nullable<Text>,
369 banner -> Nullable<Text>,
374 site_aggregates (id) {
381 users_active_day -> Int8,
382 users_active_week -> Int8,
383 users_active_month -> Int8,
384 users_active_half_year -> Int8,
392 preferred_username -> Nullable<Varchar>,
393 password_encrypted -> Text,
394 email -> Nullable<Text>,
395 avatar -> Nullable<Text>,
398 published -> Timestamp,
399 updated -> Nullable<Timestamp>,
402 default_sort_type -> Int2,
403 default_listing_type -> Int2,
405 show_avatars -> Bool,
406 send_notifications_to_email -> Bool,
407 matrix_user_id -> Nullable<Text>,
409 bio -> Nullable<Text>,
411 private_key -> Nullable<Text>,
412 public_key -> Nullable<Text>,
413 last_refreshed_at -> Timestamp,
414 banner -> Nullable<Text>,
417 shared_inbox_url -> Nullable<Text>,
422 user_aggregates (id) {
427 comment_count -> Int8,
428 comment_score -> Int8,
436 published -> Timestamp,
443 recipient_id -> Int4,
446 published -> Timestamp,
450 // These are necessary since diesel doesn't have self joins / aliases
452 comment_alias_1 (id) {
456 parent_id -> Nullable<Int4>,
460 published -> Timestamp,
461 updated -> Nullable<Timestamp>,
472 preferred_username -> Nullable<Varchar>,
473 password_encrypted -> Text,
474 email -> Nullable<Text>,
475 avatar -> Nullable<Text>,
478 published -> Timestamp,
479 updated -> Nullable<Timestamp>,
482 default_sort_type -> Int2,
483 default_listing_type -> Int2,
485 show_avatars -> Bool,
486 send_notifications_to_email -> Bool,
487 matrix_user_id -> Nullable<Text>,
489 bio -> Nullable<Text>,
491 private_key -> Nullable<Text>,
492 public_key -> Nullable<Text>,
493 last_refreshed_at -> Timestamp,
494 banner -> Nullable<Text>,
503 preferred_username -> Nullable<Varchar>,
504 password_encrypted -> Text,
505 email -> Nullable<Text>,
506 avatar -> Nullable<Text>,
509 published -> Timestamp,
510 updated -> Nullable<Timestamp>,
513 default_sort_type -> Int2,
514 default_listing_type -> Int2,
516 show_avatars -> Bool,
517 send_notifications_to_email -> Bool,
518 matrix_user_id -> Nullable<Text>,
520 bio -> Nullable<Text>,
522 private_key -> Nullable<Text>,
523 public_key -> Nullable<Text>,
524 last_refreshed_at -> Timestamp,
525 banner -> Nullable<Text>,
530 joinable!(comment_alias_1 -> user_alias_1 (creator_id));
531 joinable!(comment -> comment_alias_1 (parent_id));
532 joinable!(user_mention -> user_alias_1 (recipient_id));
533 joinable!(post -> user_alias_1 (creator_id));
534 joinable!(comment -> user_alias_1 (creator_id));
536 joinable!(post_report -> user_alias_2 (resolver_id));
537 joinable!(comment_report -> user_alias_2 (resolver_id));
539 joinable!(comment -> post (post_id));
540 joinable!(comment -> user_ (creator_id));
541 joinable!(comment_aggregates -> comment (comment_id));
542 joinable!(comment_like -> comment (comment_id));
543 joinable!(comment_like -> post (post_id));
544 joinable!(comment_like -> user_ (user_id));
545 joinable!(comment_report -> comment (comment_id));
546 joinable!(comment_saved -> comment (comment_id));
547 joinable!(comment_saved -> user_ (user_id));
548 joinable!(community -> category (category_id));
549 joinable!(community -> user_ (creator_id));
550 joinable!(community_aggregates -> community (community_id));
551 joinable!(community_follower -> community (community_id));
552 joinable!(community_follower -> user_ (user_id));
553 joinable!(community_moderator -> community (community_id));
554 joinable!(community_moderator -> user_ (user_id));
555 joinable!(community_user_ban -> community (community_id));
556 joinable!(community_user_ban -> user_ (user_id));
557 joinable!(mod_add_community -> community (community_id));
558 joinable!(mod_ban_from_community -> community (community_id));
559 joinable!(mod_lock_post -> post (post_id));
560 joinable!(mod_lock_post -> user_ (mod_user_id));
561 joinable!(mod_remove_comment -> comment (comment_id));
562 joinable!(mod_remove_comment -> user_ (mod_user_id));
563 joinable!(mod_remove_community -> community (community_id));
564 joinable!(mod_remove_community -> user_ (mod_user_id));
565 joinable!(mod_remove_post -> post (post_id));
566 joinable!(mod_remove_post -> user_ (mod_user_id));
567 joinable!(mod_sticky_post -> post (post_id));
568 joinable!(mod_sticky_post -> user_ (mod_user_id));
569 joinable!(password_reset_request -> user_ (user_id));
570 joinable!(post -> community (community_id));
571 joinable!(post -> user_ (creator_id));
572 joinable!(post_aggregates -> post (post_id));
573 joinable!(post_like -> post (post_id));
574 joinable!(post_like -> user_ (user_id));
575 joinable!(post_read -> post (post_id));
576 joinable!(post_read -> user_ (user_id));
577 joinable!(post_report -> post (post_id));
578 joinable!(post_saved -> post (post_id));
579 joinable!(post_saved -> user_ (user_id));
580 joinable!(site -> user_ (creator_id));
581 joinable!(site_aggregates -> site (site_id));
582 joinable!(user_aggregates -> user_ (user_id));
583 joinable!(user_ban -> user_ (user_id));
584 joinable!(user_mention -> comment (comment_id));
585 joinable!(user_mention -> user_ (recipient_id));
587 allow_tables_to_appear_in_same_query!(
596 community_aggregates,
603 mod_ban_from_community,
606 mod_remove_community,
609 password_reset_request,