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<Varchar>,
93 banner -> Nullable<Varchar>,
94 followers_url -> Varchar,
96 shared_inbox_url -> Nullable<Varchar>,
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_person_ban (id) {
137 community_id -> Int4,
139 published -> Timestamp,
147 password_encrypted -> Text,
148 email -> Nullable<Text>,
151 default_sort_type -> Int2,
152 default_listing_type -> Int2,
154 show_avatars -> Bool,
155 send_notifications_to_email -> Bool,
156 validator_time -> Timestamp,
164 mod_person_id -> Int4,
165 other_person_id -> Int4,
166 removed -> Nullable<Bool>,
172 mod_add_community (id) {
174 mod_person_id -> Int4,
175 other_person_id -> Int4,
176 community_id -> Int4,
177 removed -> Nullable<Bool>,
185 mod_person_id -> Int4,
186 other_person_id -> Int4,
187 reason -> Nullable<Text>,
188 banned -> Nullable<Bool>,
189 expires -> Nullable<Timestamp>,
195 mod_ban_from_community (id) {
197 mod_person_id -> Int4,
198 other_person_id -> Int4,
199 community_id -> Int4,
200 reason -> Nullable<Text>,
201 banned -> Nullable<Bool>,
202 expires -> Nullable<Timestamp>,
210 mod_person_id -> Int4,
212 locked -> Nullable<Bool>,
218 mod_remove_comment (id) {
220 mod_person_id -> Int4,
222 reason -> Nullable<Text>,
223 removed -> Nullable<Bool>,
229 mod_remove_community (id) {
231 mod_person_id -> Int4,
232 community_id -> Int4,
233 reason -> Nullable<Text>,
234 removed -> Nullable<Bool>,
235 expires -> Nullable<Timestamp>,
241 mod_remove_post (id) {
243 mod_person_id -> Int4,
245 reason -> Nullable<Text>,
246 removed -> Nullable<Bool>,
252 mod_sticky_post (id) {
254 mod_person_id -> Int4,
256 stickied -> Nullable<Bool>,
262 password_reset_request (id) {
264 token_encrypted -> Text,
265 published -> Timestamp,
266 local_user_id -> Int4,
274 display_name -> Nullable<Varchar>,
275 avatar -> Nullable<Varchar>,
277 published -> Timestamp,
278 updated -> Nullable<Timestamp>,
280 bio -> Nullable<Text>,
282 private_key -> Nullable<Text>,
283 public_key -> Nullable<Text>,
284 last_refreshed_at -> Timestamp,
285 banner -> Nullable<Varchar>,
287 inbox_url -> Varchar,
288 shared_inbox_url -> Nullable<Varchar>,
289 matrix_user_id -> Nullable<Text>,
295 person_aggregates (id) {
300 comment_count -> Int8,
301 comment_score -> Int8,
309 published -> Timestamp,
314 person_mention (id) {
316 recipient_id -> Int4,
319 published -> Timestamp,
327 url -> Nullable<Varchar>,
328 body -> Nullable<Text>,
330 community_id -> Int4,
333 published -> Timestamp,
334 updated -> Nullable<Timestamp>,
338 embed_title -> Nullable<Text>,
339 embed_description -> Nullable<Text>,
340 embed_html -> Nullable<Text>,
341 thumbnail_url -> Nullable<Text>,
348 post_aggregates (id) {
356 published -> Timestamp,
357 newest_comment_time_necro -> Timestamp,
358 newest_comment_time -> Timestamp,
368 published -> Timestamp,
377 published -> Timestamp,
386 original_post_name -> Varchar,
387 original_post_url -> Nullable<Text>,
388 original_post_body -> Nullable<Text>,
391 resolver_id -> Nullable<Int4>,
392 published -> Timestamp,
393 updated -> Nullable<Timestamp>,
402 published -> Timestamp,
407 private_message (id) {
410 recipient_id -> Int4,
414 published -> Timestamp,
415 updated -> Nullable<Timestamp>,
425 description -> Nullable<Text>,
427 published -> Timestamp,
428 updated -> Nullable<Timestamp>,
429 enable_downvotes -> Bool,
430 open_registration -> Bool,
432 icon -> Nullable<Varchar>,
433 banner -> Nullable<Varchar>,
438 site_aggregates (id) {
445 users_active_day -> Int8,
446 users_active_week -> Int8,
447 users_active_month -> Int8,
448 users_active_half_year -> Int8,
452 // These are necessary since diesel doesn't have self joins / aliases
454 comment_alias_1 (id) {
458 parent_id -> Nullable<Int4>,
462 published -> Timestamp,
463 updated -> Nullable<Timestamp>,
471 person_alias_1 (id) {
474 display_name -> Nullable<Varchar>,
475 avatar -> Nullable<Varchar>,
477 published -> Timestamp,
478 updated -> Nullable<Timestamp>,
480 bio -> Nullable<Text>,
482 private_key -> Nullable<Text>,
483 public_key -> Nullable<Text>,
484 last_refreshed_at -> Timestamp,
485 banner -> Nullable<Varchar>,
487 inbox_url -> Varchar,
488 shared_inbox_url -> Nullable<Varchar>,
489 matrix_user_id -> Nullable<Text>,
495 person_alias_2 (id) {
498 display_name -> Nullable<Varchar>,
499 avatar -> Nullable<Varchar>,
501 published -> Timestamp,
502 updated -> Nullable<Timestamp>,
504 bio -> Nullable<Text>,
506 private_key -> Nullable<Text>,
507 public_key -> Nullable<Text>,
508 last_refreshed_at -> Timestamp,
509 banner -> Nullable<Varchar>,
511 inbox_url -> Varchar,
512 shared_inbox_url -> Nullable<Varchar>,
513 matrix_user_id -> Nullable<Text>,
518 joinable!(comment_alias_1 -> person_alias_1 (creator_id));
519 joinable!(comment -> comment_alias_1 (parent_id));
520 joinable!(person_mention -> person_alias_1 (recipient_id));
521 joinable!(post -> person_alias_1 (creator_id));
522 joinable!(comment -> person_alias_1 (creator_id));
524 joinable!(post_report -> person_alias_2 (resolver_id));
525 joinable!(comment_report -> person_alias_2 (resolver_id));
527 joinable!(comment -> person (creator_id));
528 joinable!(comment -> post (post_id));
529 joinable!(comment_aggregates -> comment (comment_id));
530 joinable!(comment_like -> comment (comment_id));
531 joinable!(comment_like -> person (person_id));
532 joinable!(comment_like -> post (post_id));
533 joinable!(comment_report -> comment (comment_id));
534 joinable!(comment_saved -> comment (comment_id));
535 joinable!(comment_saved -> person (person_id));
536 joinable!(community -> person (creator_id));
537 joinable!(community_aggregates -> community (community_id));
538 joinable!(community_follower -> community (community_id));
539 joinable!(community_follower -> person (person_id));
540 joinable!(community_moderator -> community (community_id));
541 joinable!(community_moderator -> person (person_id));
542 joinable!(community_person_ban -> community (community_id));
543 joinable!(community_person_ban -> person (person_id));
544 joinable!(local_user -> person (person_id));
545 joinable!(mod_add_community -> community (community_id));
546 joinable!(mod_ban_from_community -> community (community_id));
547 joinable!(mod_lock_post -> person (mod_person_id));
548 joinable!(mod_lock_post -> post (post_id));
549 joinable!(mod_remove_comment -> comment (comment_id));
550 joinable!(mod_remove_comment -> person (mod_person_id));
551 joinable!(mod_remove_community -> community (community_id));
552 joinable!(mod_remove_community -> person (mod_person_id));
553 joinable!(mod_remove_post -> person (mod_person_id));
554 joinable!(mod_remove_post -> post (post_id));
555 joinable!(mod_sticky_post -> person (mod_person_id));
556 joinable!(mod_sticky_post -> post (post_id));
557 joinable!(password_reset_request -> local_user (local_user_id));
558 joinable!(person_aggregates -> person (person_id));
559 joinable!(person_ban -> person (person_id));
560 joinable!(person_mention -> comment (comment_id));
561 joinable!(person_mention -> person (recipient_id));
562 joinable!(post -> community (community_id));
563 joinable!(post -> person (creator_id));
564 joinable!(post_aggregates -> post (post_id));
565 joinable!(post_like -> person (person_id));
566 joinable!(post_like -> post (post_id));
567 joinable!(post_read -> person (person_id));
568 joinable!(post_read -> post (post_id));
569 joinable!(post_report -> post (post_id));
570 joinable!(post_saved -> person (person_id));
571 joinable!(post_saved -> post (post_id));
572 joinable!(site -> person (creator_id));
573 joinable!(site_aggregates -> site (site_id));
575 allow_tables_to_appear_in_same_query!(
583 community_aggregates,
586 community_person_ban,
591 mod_ban_from_community,
594 mod_remove_community,
597 password_reset_request,