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>,
152 default_sort_type -> Int2,
153 default_listing_type -> Int2,
155 show_avatars -> Bool,
156 send_notifications_to_email -> Bool,
157 matrix_user_id -> Nullable<Text>,
158 validator_time -> Timestamp,
165 mod_person_id -> Int4,
166 other_person_id -> Int4,
167 removed -> Nullable<Bool>,
173 mod_add_community (id) {
175 mod_person_id -> Int4,
176 other_person_id -> Int4,
177 community_id -> Int4,
178 removed -> Nullable<Bool>,
186 mod_person_id -> Int4,
187 other_person_id -> Int4,
188 reason -> Nullable<Text>,
189 banned -> Nullable<Bool>,
190 expires -> Nullable<Timestamp>,
196 mod_ban_from_community (id) {
198 mod_person_id -> Int4,
199 other_person_id -> Int4,
200 community_id -> Int4,
201 reason -> Nullable<Text>,
202 banned -> Nullable<Bool>,
203 expires -> Nullable<Timestamp>,
211 mod_person_id -> Int4,
213 locked -> Nullable<Bool>,
219 mod_remove_comment (id) {
221 mod_person_id -> Int4,
223 reason -> Nullable<Text>,
224 removed -> Nullable<Bool>,
230 mod_remove_community (id) {
232 mod_person_id -> Int4,
233 community_id -> Int4,
234 reason -> Nullable<Text>,
235 removed -> Nullable<Bool>,
236 expires -> Nullable<Timestamp>,
242 mod_remove_post (id) {
244 mod_person_id -> Int4,
246 reason -> Nullable<Text>,
247 removed -> Nullable<Bool>,
253 mod_sticky_post (id) {
255 mod_person_id -> Int4,
257 stickied -> Nullable<Bool>,
263 password_reset_request (id) {
265 token_encrypted -> Text,
266 published -> Timestamp,
267 local_user_id -> Int4,
275 preferred_username -> Nullable<Varchar>,
276 avatar -> Nullable<Varchar>,
278 published -> Timestamp,
279 updated -> Nullable<Timestamp>,
281 bio -> Nullable<Text>,
283 private_key -> Nullable<Text>,
284 public_key -> Nullable<Text>,
285 last_refreshed_at -> Timestamp,
286 banner -> Nullable<Varchar>,
288 inbox_url -> Varchar,
289 shared_inbox_url -> Nullable<Varchar>,
294 person_aggregates (id) {
299 comment_count -> Int8,
300 comment_score -> Int8,
308 published -> Timestamp,
313 person_mention (id) {
315 recipient_id -> Int4,
318 published -> Timestamp,
326 url -> Nullable<Varchar>,
327 body -> Nullable<Text>,
329 community_id -> Int4,
332 published -> Timestamp,
333 updated -> Nullable<Timestamp>,
337 embed_title -> Nullable<Text>,
338 embed_description -> Nullable<Text>,
339 embed_html -> Nullable<Text>,
340 thumbnail_url -> Nullable<Text>,
347 post_aggregates (id) {
355 published -> Timestamp,
356 newest_comment_time_necro -> Timestamp,
357 newest_comment_time -> Timestamp,
367 published -> Timestamp,
376 published -> Timestamp,
385 original_post_name -> Varchar,
386 original_post_url -> Nullable<Text>,
387 original_post_body -> Nullable<Text>,
390 resolver_id -> Nullable<Int4>,
391 published -> Timestamp,
392 updated -> Nullable<Timestamp>,
401 published -> Timestamp,
406 private_message (id) {
409 recipient_id -> Int4,
413 published -> Timestamp,
414 updated -> Nullable<Timestamp>,
424 description -> Nullable<Text>,
426 published -> Timestamp,
427 updated -> Nullable<Timestamp>,
428 enable_downvotes -> Bool,
429 open_registration -> Bool,
431 icon -> Nullable<Varchar>,
432 banner -> Nullable<Varchar>,
437 site_aggregates (id) {
444 users_active_day -> Int8,
445 users_active_week -> Int8,
446 users_active_month -> Int8,
447 users_active_half_year -> Int8,
451 // These are necessary since diesel doesn't have self joins / aliases
453 comment_alias_1 (id) {
457 parent_id -> Nullable<Int4>,
461 published -> Timestamp,
462 updated -> Nullable<Timestamp>,
470 person_alias_1 (id) {
473 preferred_username -> Nullable<Varchar>,
474 avatar -> Nullable<Varchar>,
476 published -> Timestamp,
477 updated -> Nullable<Timestamp>,
479 bio -> Nullable<Text>,
481 private_key -> Nullable<Text>,
482 public_key -> Nullable<Text>,
483 last_refreshed_at -> Timestamp,
484 banner -> Nullable<Varchar>,
486 inbox_url -> Varchar,
487 shared_inbox_url -> Nullable<Varchar>,
492 person_alias_2 (id) {
495 preferred_username -> Nullable<Varchar>,
496 avatar -> Nullable<Varchar>,
498 published -> Timestamp,
499 updated -> Nullable<Timestamp>,
501 bio -> Nullable<Text>,
503 private_key -> Nullable<Text>,
504 public_key -> Nullable<Text>,
505 last_refreshed_at -> Timestamp,
506 banner -> Nullable<Varchar>,
508 inbox_url -> Varchar,
509 shared_inbox_url -> Nullable<Varchar>,
513 joinable!(comment_alias_1 -> person_alias_1 (creator_id));
514 joinable!(comment -> comment_alias_1 (parent_id));
515 joinable!(person_mention -> person_alias_1 (recipient_id));
516 joinable!(post -> person_alias_1 (creator_id));
517 joinable!(comment -> person_alias_1 (creator_id));
519 joinable!(post_report -> person_alias_2 (resolver_id));
520 joinable!(comment_report -> person_alias_2 (resolver_id));
522 joinable!(comment -> person (creator_id));
523 joinable!(comment -> post (post_id));
524 joinable!(comment_aggregates -> comment (comment_id));
525 joinable!(comment_like -> comment (comment_id));
526 joinable!(comment_like -> person (person_id));
527 joinable!(comment_like -> post (post_id));
528 joinable!(comment_report -> comment (comment_id));
529 joinable!(comment_saved -> comment (comment_id));
530 joinable!(comment_saved -> person (person_id));
531 joinable!(community -> person (creator_id));
532 joinable!(community_aggregates -> community (community_id));
533 joinable!(community_follower -> community (community_id));
534 joinable!(community_follower -> person (person_id));
535 joinable!(community_moderator -> community (community_id));
536 joinable!(community_moderator -> person (person_id));
537 joinable!(community_person_ban -> community (community_id));
538 joinable!(community_person_ban -> person (person_id));
539 joinable!(local_user -> person (person_id));
540 joinable!(mod_add_community -> community (community_id));
541 joinable!(mod_ban_from_community -> community (community_id));
542 joinable!(mod_lock_post -> person (mod_person_id));
543 joinable!(mod_lock_post -> post (post_id));
544 joinable!(mod_remove_comment -> comment (comment_id));
545 joinable!(mod_remove_comment -> person (mod_person_id));
546 joinable!(mod_remove_community -> community (community_id));
547 joinable!(mod_remove_community -> person (mod_person_id));
548 joinable!(mod_remove_post -> person (mod_person_id));
549 joinable!(mod_remove_post -> post (post_id));
550 joinable!(mod_sticky_post -> person (mod_person_id));
551 joinable!(mod_sticky_post -> post (post_id));
552 joinable!(password_reset_request -> local_user (local_user_id));
553 joinable!(person_aggregates -> person (person_id));
554 joinable!(person_ban -> person (person_id));
555 joinable!(person_mention -> comment (comment_id));
556 joinable!(person_mention -> person (recipient_id));
557 joinable!(post -> community (community_id));
558 joinable!(post -> person (creator_id));
559 joinable!(post_aggregates -> post (post_id));
560 joinable!(post_like -> person (person_id));
561 joinable!(post_like -> post (post_id));
562 joinable!(post_read -> person (person_id));
563 joinable!(post_read -> post (post_id));
564 joinable!(post_report -> post (post_id));
565 joinable!(post_saved -> person (person_id));
566 joinable!(post_saved -> post (post_id));
567 joinable!(site -> person (creator_id));
568 joinable!(site_aggregates -> site (site_id));
570 allow_tables_to_appear_in_same_query!(
578 community_aggregates,
581 community_person_ban,
586 mod_ban_from_community,
589 mod_remove_community,
592 password_reset_request,