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,
117 community_follower (id) {
119 community_id -> Int4,
121 published -> Timestamp,
122 pending -> Nullable<Bool>,
127 community_moderator (id) {
129 community_id -> Int4,
131 published -> Timestamp,
136 community_user_ban (id) {
138 community_id -> Int4,
140 published -> Timestamp,
148 other_user_id -> Int4,
149 removed -> Nullable<Bool>,
155 mod_add_community (id) {
158 other_user_id -> Int4,
159 community_id -> Int4,
160 removed -> Nullable<Bool>,
169 other_user_id -> Int4,
170 reason -> Nullable<Text>,
171 banned -> Nullable<Bool>,
172 expires -> Nullable<Timestamp>,
178 mod_ban_from_community (id) {
181 other_user_id -> Int4,
182 community_id -> Int4,
183 reason -> Nullable<Text>,
184 banned -> Nullable<Bool>,
185 expires -> Nullable<Timestamp>,
195 locked -> Nullable<Bool>,
201 mod_remove_comment (id) {
205 reason -> Nullable<Text>,
206 removed -> Nullable<Bool>,
212 mod_remove_community (id) {
215 community_id -> Int4,
216 reason -> Nullable<Text>,
217 removed -> Nullable<Bool>,
218 expires -> Nullable<Timestamp>,
224 mod_remove_post (id) {
228 reason -> Nullable<Text>,
229 removed -> Nullable<Bool>,
235 mod_sticky_post (id) {
239 stickied -> Nullable<Bool>,
245 password_reset_request (id) {
248 token_encrypted -> Text,
249 published -> Timestamp,
257 url -> Nullable<Text>,
258 body -> Nullable<Text>,
260 community_id -> Int4,
263 published -> Timestamp,
264 updated -> Nullable<Timestamp>,
268 embed_title -> Nullable<Text>,
269 embed_description -> Nullable<Text>,
270 embed_html -> Nullable<Text>,
271 thumbnail_url -> Nullable<Text>,
278 post_aggregates (id) {
286 published -> 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) {
381 preferred_username -> Nullable<Varchar>,
382 password_encrypted -> Text,
383 email -> Nullable<Text>,
384 avatar -> Nullable<Text>,
387 published -> Timestamp,
388 updated -> Nullable<Timestamp>,
391 default_sort_type -> Int2,
392 default_listing_type -> Int2,
394 show_avatars -> Bool,
395 send_notifications_to_email -> Bool,
396 matrix_user_id -> Nullable<Text>,
398 bio -> Nullable<Text>,
400 private_key -> Nullable<Text>,
401 public_key -> Nullable<Text>,
402 last_refreshed_at -> Timestamp,
403 banner -> Nullable<Text>,
409 user_aggregates (id) {
414 comment_count -> Int8,
415 comment_score -> Int8,
423 published -> Timestamp,
430 recipient_id -> Int4,
433 published -> Timestamp,
437 // These are necessary since diesel doesn't have self joins / aliases
439 comment_alias_1 (id) {
443 parent_id -> Nullable<Int4>,
447 published -> Timestamp,
448 updated -> Nullable<Timestamp>,
459 preferred_username -> Nullable<Varchar>,
460 password_encrypted -> Text,
461 email -> Nullable<Text>,
462 avatar -> Nullable<Text>,
465 published -> Timestamp,
466 updated -> Nullable<Timestamp>,
469 default_sort_type -> Int2,
470 default_listing_type -> Int2,
472 show_avatars -> Bool,
473 send_notifications_to_email -> Bool,
474 matrix_user_id -> Nullable<Text>,
476 bio -> Nullable<Text>,
478 private_key -> Nullable<Text>,
479 public_key -> Nullable<Text>,
480 last_refreshed_at -> Timestamp,
481 banner -> Nullable<Text>,
490 preferred_username -> Nullable<Varchar>,
491 password_encrypted -> Text,
492 email -> Nullable<Text>,
493 avatar -> Nullable<Text>,
496 published -> Timestamp,
497 updated -> Nullable<Timestamp>,
500 default_sort_type -> Int2,
501 default_listing_type -> Int2,
503 show_avatars -> Bool,
504 send_notifications_to_email -> Bool,
505 matrix_user_id -> Nullable<Text>,
507 bio -> Nullable<Text>,
509 private_key -> Nullable<Text>,
510 public_key -> Nullable<Text>,
511 last_refreshed_at -> Timestamp,
512 banner -> Nullable<Text>,
517 joinable!(comment_alias_1 -> user_alias_1 (creator_id));
518 joinable!(comment -> comment_alias_1 (parent_id));
519 joinable!(user_mention -> user_alias_1 (recipient_id));
520 joinable!(post -> user_alias_1 (creator_id));
521 joinable!(comment -> user_alias_1 (creator_id));
523 joinable!(post_report -> user_alias_2 (resolver_id));
524 joinable!(comment_report -> user_alias_2 (resolver_id));
526 joinable!(comment -> post (post_id));
527 joinable!(comment -> user_ (creator_id));
528 joinable!(comment_aggregates -> comment (comment_id));
529 joinable!(comment_like -> comment (comment_id));
530 joinable!(comment_like -> post (post_id));
531 joinable!(comment_like -> user_ (user_id));
532 joinable!(comment_report -> comment (comment_id));
533 joinable!(comment_saved -> comment (comment_id));
534 joinable!(comment_saved -> user_ (user_id));
535 joinable!(community -> category (category_id));
536 joinable!(community -> user_ (creator_id));
537 joinable!(community_aggregates -> community (community_id));
538 joinable!(community_follower -> community (community_id));
539 joinable!(community_follower -> user_ (user_id));
540 joinable!(community_moderator -> community (community_id));
541 joinable!(community_moderator -> user_ (user_id));
542 joinable!(community_user_ban -> community (community_id));
543 joinable!(community_user_ban -> user_ (user_id));
544 joinable!(mod_add_community -> community (community_id));
545 joinable!(mod_ban_from_community -> community (community_id));
546 joinable!(mod_lock_post -> post (post_id));
547 joinable!(mod_lock_post -> user_ (mod_user_id));
548 joinable!(mod_remove_comment -> comment (comment_id));
549 joinable!(mod_remove_comment -> user_ (mod_user_id));
550 joinable!(mod_remove_community -> community (community_id));
551 joinable!(mod_remove_community -> user_ (mod_user_id));
552 joinable!(mod_remove_post -> post (post_id));
553 joinable!(mod_remove_post -> user_ (mod_user_id));
554 joinable!(mod_sticky_post -> post (post_id));
555 joinable!(mod_sticky_post -> user_ (mod_user_id));
556 joinable!(password_reset_request -> user_ (user_id));
557 joinable!(post -> community (community_id));
558 joinable!(post -> user_ (creator_id));
559 joinable!(post_aggregates -> post (post_id));
560 joinable!(post_like -> post (post_id));
561 joinable!(post_like -> user_ (user_id));
562 joinable!(post_read -> post (post_id));
563 joinable!(post_read -> user_ (user_id));
564 joinable!(post_report -> post (post_id));
565 joinable!(post_saved -> post (post_id));
566 joinable!(post_saved -> user_ (user_id));
567 joinable!(site -> user_ (creator_id));
568 joinable!(site_aggregates -> site (site_id));
569 joinable!(user_aggregates -> user_ (user_id));
570 joinable!(user_ban -> user_ (user_id));
571 joinable!(user_mention -> comment (comment_id));
572 joinable!(user_mention -> user_ (recipient_id));
574 allow_tables_to_appear_in_same_query!(
583 community_aggregates,
590 mod_ban_from_community,
593 mod_remove_community,
596 password_reset_request,