]> Untitled Git - lemmy.git/blob - server/lemmy_db/src/schema.rs
Translated using Weblate (Italian)
[lemmy.git] / server / lemmy_db / src / schema.rs
1 table! {
2     activity (id) {
3         id -> Int4,
4         user_id -> Int4,
5         data -> Jsonb,
6         local -> Bool,
7         published -> Timestamp,
8         updated -> Nullable<Timestamp>,
9     }
10 }
11
12 table! {
13     category (id) {
14         id -> Int4,
15         name -> Varchar,
16     }
17 }
18
19 table! {
20     comment (id) {
21         id -> Int4,
22         creator_id -> Int4,
23         post_id -> Int4,
24         parent_id -> Nullable<Int4>,
25         content -> Text,
26         removed -> Bool,
27         read -> Bool,
28         published -> Timestamp,
29         updated -> Nullable<Timestamp>,
30         deleted -> Bool,
31         ap_id -> Varchar,
32         local -> Bool,
33     }
34 }
35
36 table! {
37     comment_aggregates_fast (id) {
38         id -> Int4,
39         creator_id -> Nullable<Int4>,
40         post_id -> Nullable<Int4>,
41         parent_id -> Nullable<Int4>,
42         content -> Nullable<Text>,
43         removed -> Nullable<Bool>,
44         read -> Nullable<Bool>,
45         published -> Nullable<Timestamp>,
46         updated -> Nullable<Timestamp>,
47         deleted -> Nullable<Bool>,
48         ap_id -> Nullable<Varchar>,
49         local -> Nullable<Bool>,
50         post_name -> Nullable<Varchar>,
51         community_id -> Nullable<Int4>,
52         community_actor_id -> Nullable<Varchar>,
53         community_local -> Nullable<Bool>,
54         community_name -> Nullable<Varchar>,
55         banned -> Nullable<Bool>,
56         banned_from_community -> Nullable<Bool>,
57         creator_actor_id -> Nullable<Varchar>,
58         creator_local -> Nullable<Bool>,
59         creator_name -> Nullable<Varchar>,
60         creator_published -> Nullable<Timestamp>,
61         creator_avatar -> Nullable<Text>,
62         score -> Nullable<Int8>,
63         upvotes -> Nullable<Int8>,
64         downvotes -> Nullable<Int8>,
65         hot_rank -> Nullable<Int4>,
66     }
67 }
68
69 table! {
70     comment_like (id) {
71         id -> Int4,
72         user_id -> Int4,
73         comment_id -> Int4,
74         post_id -> Int4,
75         score -> Int2,
76         published -> Timestamp,
77     }
78 }
79
80 table! {
81     comment_saved (id) {
82         id -> Int4,
83         comment_id -> Int4,
84         user_id -> Int4,
85         published -> Timestamp,
86     }
87 }
88
89 table! {
90     community (id) {
91         id -> Int4,
92         name -> Varchar,
93         title -> Varchar,
94         description -> Nullable<Text>,
95         category_id -> Int4,
96         creator_id -> Int4,
97         removed -> Bool,
98         published -> Timestamp,
99         updated -> Nullable<Timestamp>,
100         deleted -> Bool,
101         nsfw -> Bool,
102         actor_id -> Varchar,
103         local -> Bool,
104         private_key -> Nullable<Text>,
105         public_key -> Nullable<Text>,
106         last_refreshed_at -> Timestamp,
107     }
108 }
109
110 table! {
111     community_aggregates_fast (id) {
112         id -> Int4,
113         name -> Nullable<Varchar>,
114         title -> Nullable<Varchar>,
115         description -> Nullable<Text>,
116         category_id -> Nullable<Int4>,
117         creator_id -> Nullable<Int4>,
118         removed -> Nullable<Bool>,
119         published -> Nullable<Timestamp>,
120         updated -> Nullable<Timestamp>,
121         deleted -> Nullable<Bool>,
122         nsfw -> Nullable<Bool>,
123         actor_id -> Nullable<Varchar>,
124         local -> Nullable<Bool>,
125         last_refreshed_at -> Nullable<Timestamp>,
126         creator_actor_id -> Nullable<Varchar>,
127         creator_local -> Nullable<Bool>,
128         creator_name -> Nullable<Varchar>,
129         creator_avatar -> Nullable<Text>,
130         category_name -> Nullable<Varchar>,
131         number_of_subscribers -> Nullable<Int8>,
132         number_of_posts -> Nullable<Int8>,
133         number_of_comments -> Nullable<Int8>,
134         hot_rank -> Nullable<Int4>,
135     }
136 }
137
138 table! {
139     community_follower (id) {
140         id -> Int4,
141         community_id -> Int4,
142         user_id -> Int4,
143         published -> Timestamp,
144     }
145 }
146
147 table! {
148     community_moderator (id) {
149         id -> Int4,
150         community_id -> Int4,
151         user_id -> Int4,
152         published -> Timestamp,
153     }
154 }
155
156 table! {
157     community_user_ban (id) {
158         id -> Int4,
159         community_id -> Int4,
160         user_id -> Int4,
161         published -> Timestamp,
162     }
163 }
164
165 table! {
166     mod_add (id) {
167         id -> Int4,
168         mod_user_id -> Int4,
169         other_user_id -> Int4,
170         removed -> Nullable<Bool>,
171         when_ -> Timestamp,
172     }
173 }
174
175 table! {
176     mod_add_community (id) {
177         id -> Int4,
178         mod_user_id -> Int4,
179         other_user_id -> Int4,
180         community_id -> Int4,
181         removed -> Nullable<Bool>,
182         when_ -> Timestamp,
183     }
184 }
185
186 table! {
187     mod_ban (id) {
188         id -> Int4,
189         mod_user_id -> Int4,
190         other_user_id -> Int4,
191         reason -> Nullable<Text>,
192         banned -> Nullable<Bool>,
193         expires -> Nullable<Timestamp>,
194         when_ -> Timestamp,
195     }
196 }
197
198 table! {
199     mod_ban_from_community (id) {
200         id -> Int4,
201         mod_user_id -> Int4,
202         other_user_id -> Int4,
203         community_id -> Int4,
204         reason -> Nullable<Text>,
205         banned -> Nullable<Bool>,
206         expires -> Nullable<Timestamp>,
207         when_ -> Timestamp,
208     }
209 }
210
211 table! {
212     mod_lock_post (id) {
213         id -> Int4,
214         mod_user_id -> Int4,
215         post_id -> Int4,
216         locked -> Nullable<Bool>,
217         when_ -> Timestamp,
218     }
219 }
220
221 table! {
222     mod_remove_comment (id) {
223         id -> Int4,
224         mod_user_id -> Int4,
225         comment_id -> Int4,
226         reason -> Nullable<Text>,
227         removed -> Nullable<Bool>,
228         when_ -> Timestamp,
229     }
230 }
231
232 table! {
233     mod_remove_community (id) {
234         id -> Int4,
235         mod_user_id -> Int4,
236         community_id -> Int4,
237         reason -> Nullable<Text>,
238         removed -> Nullable<Bool>,
239         expires -> Nullable<Timestamp>,
240         when_ -> Timestamp,
241     }
242 }
243
244 table! {
245     mod_remove_post (id) {
246         id -> Int4,
247         mod_user_id -> Int4,
248         post_id -> Int4,
249         reason -> Nullable<Text>,
250         removed -> Nullable<Bool>,
251         when_ -> Timestamp,
252     }
253 }
254
255 table! {
256     mod_sticky_post (id) {
257         id -> Int4,
258         mod_user_id -> Int4,
259         post_id -> Int4,
260         stickied -> Nullable<Bool>,
261         when_ -> Timestamp,
262     }
263 }
264
265 table! {
266     password_reset_request (id) {
267         id -> Int4,
268         user_id -> Int4,
269         token_encrypted -> Text,
270         published -> Timestamp,
271     }
272 }
273
274 table! {
275     post (id) {
276         id -> Int4,
277         name -> Varchar,
278         url -> Nullable<Text>,
279         body -> Nullable<Text>,
280         creator_id -> Int4,
281         community_id -> Int4,
282         removed -> Bool,
283         locked -> Bool,
284         published -> Timestamp,
285         updated -> Nullable<Timestamp>,
286         deleted -> Bool,
287         nsfw -> Bool,
288         stickied -> Bool,
289         embed_title -> Nullable<Text>,
290         embed_description -> Nullable<Text>,
291         embed_html -> Nullable<Text>,
292         thumbnail_url -> Nullable<Text>,
293         ap_id -> Varchar,
294         local -> Bool,
295     }
296 }
297
298 table! {
299     post_aggregates_fast (id) {
300         id -> Int4,
301         name -> Nullable<Varchar>,
302         url -> Nullable<Text>,
303         body -> Nullable<Text>,
304         creator_id -> Nullable<Int4>,
305         community_id -> Nullable<Int4>,
306         removed -> Nullable<Bool>,
307         locked -> Nullable<Bool>,
308         published -> Nullable<Timestamp>,
309         updated -> Nullable<Timestamp>,
310         deleted -> Nullable<Bool>,
311         nsfw -> Nullable<Bool>,
312         stickied -> Nullable<Bool>,
313         embed_title -> Nullable<Text>,
314         embed_description -> Nullable<Text>,
315         embed_html -> Nullable<Text>,
316         thumbnail_url -> Nullable<Text>,
317         ap_id -> Nullable<Varchar>,
318         local -> Nullable<Bool>,
319         creator_actor_id -> Nullable<Varchar>,
320         creator_local -> Nullable<Bool>,
321         creator_name -> Nullable<Varchar>,
322         creator_published -> Nullable<Timestamp>,
323         creator_avatar -> Nullable<Text>,
324         banned -> Nullable<Bool>,
325         banned_from_community -> Nullable<Bool>,
326         community_actor_id -> Nullable<Varchar>,
327         community_local -> Nullable<Bool>,
328         community_name -> Nullable<Varchar>,
329         community_removed -> Nullable<Bool>,
330         community_deleted -> Nullable<Bool>,
331         community_nsfw -> Nullable<Bool>,
332         number_of_comments -> Nullable<Int8>,
333         score -> Nullable<Int8>,
334         upvotes -> Nullable<Int8>,
335         downvotes -> Nullable<Int8>,
336         hot_rank -> Nullable<Int4>,
337         newest_activity_time -> Nullable<Timestamp>,
338     }
339 }
340
341 table! {
342     post_like (id) {
343         id -> Int4,
344         post_id -> Int4,
345         user_id -> Int4,
346         score -> Int2,
347         published -> Timestamp,
348     }
349 }
350
351 table! {
352     post_read (id) {
353         id -> Int4,
354         post_id -> Int4,
355         user_id -> Int4,
356         published -> Timestamp,
357     }
358 }
359
360 table! {
361     post_saved (id) {
362         id -> Int4,
363         post_id -> Int4,
364         user_id -> Int4,
365         published -> Timestamp,
366     }
367 }
368
369 table! {
370     private_message (id) {
371         id -> Int4,
372         creator_id -> Int4,
373         recipient_id -> Int4,
374         content -> Text,
375         deleted -> Bool,
376         read -> Bool,
377         published -> Timestamp,
378         updated -> Nullable<Timestamp>,
379         ap_id -> Varchar,
380         local -> Bool,
381     }
382 }
383
384 table! {
385     site (id) {
386         id -> Int4,
387         name -> Varchar,
388         description -> Nullable<Text>,
389         creator_id -> Int4,
390         published -> Timestamp,
391         updated -> Nullable<Timestamp>,
392         enable_downvotes -> Bool,
393         open_registration -> Bool,
394         enable_nsfw -> Bool,
395     }
396 }
397
398 table! {
399     user_ (id) {
400         id -> Int4,
401         name -> Varchar,
402         preferred_username -> Nullable<Varchar>,
403         password_encrypted -> Text,
404         email -> Nullable<Text>,
405         avatar -> Nullable<Text>,
406         admin -> Bool,
407         banned -> Bool,
408         published -> Timestamp,
409         updated -> Nullable<Timestamp>,
410         show_nsfw -> Bool,
411         theme -> Varchar,
412         default_sort_type -> Int2,
413         default_listing_type -> Int2,
414         lang -> Varchar,
415         show_avatars -> Bool,
416         send_notifications_to_email -> Bool,
417         matrix_user_id -> Nullable<Text>,
418         actor_id -> Varchar,
419         bio -> Nullable<Text>,
420         local -> Bool,
421         private_key -> Nullable<Text>,
422         public_key -> Nullable<Text>,
423         last_refreshed_at -> Timestamp,
424     }
425 }
426
427 table! {
428     user_ban (id) {
429         id -> Int4,
430         user_id -> Int4,
431         published -> Timestamp,
432     }
433 }
434
435 table! {
436     user_fast (id) {
437         id -> Int4,
438         actor_id -> Nullable<Varchar>,
439         name -> Nullable<Varchar>,
440         avatar -> Nullable<Text>,
441         email -> Nullable<Text>,
442         matrix_user_id -> Nullable<Text>,
443         bio -> Nullable<Text>,
444         local -> Nullable<Bool>,
445         admin -> Nullable<Bool>,
446         banned -> Nullable<Bool>,
447         show_avatars -> Nullable<Bool>,
448         send_notifications_to_email -> Nullable<Bool>,
449         published -> Nullable<Timestamp>,
450         number_of_posts -> Nullable<Int8>,
451         post_score -> Nullable<Int8>,
452         number_of_comments -> Nullable<Int8>,
453         comment_score -> Nullable<Int8>,
454     }
455 }
456
457 table! {
458     user_mention (id) {
459         id -> Int4,
460         recipient_id -> Int4,
461         comment_id -> Int4,
462         read -> Bool,
463         published -> Timestamp,
464     }
465 }
466
467 joinable!(activity -> user_ (user_id));
468 joinable!(comment -> post (post_id));
469 joinable!(comment -> user_ (creator_id));
470 joinable!(comment_like -> comment (comment_id));
471 joinable!(comment_like -> post (post_id));
472 joinable!(comment_like -> user_ (user_id));
473 joinable!(comment_saved -> comment (comment_id));
474 joinable!(comment_saved -> user_ (user_id));
475 joinable!(community -> category (category_id));
476 joinable!(community -> user_ (creator_id));
477 joinable!(community_follower -> community (community_id));
478 joinable!(community_follower -> user_ (user_id));
479 joinable!(community_moderator -> community (community_id));
480 joinable!(community_moderator -> user_ (user_id));
481 joinable!(community_user_ban -> community (community_id));
482 joinable!(community_user_ban -> user_ (user_id));
483 joinable!(mod_add_community -> community (community_id));
484 joinable!(mod_ban_from_community -> community (community_id));
485 joinable!(mod_lock_post -> post (post_id));
486 joinable!(mod_lock_post -> user_ (mod_user_id));
487 joinable!(mod_remove_comment -> comment (comment_id));
488 joinable!(mod_remove_comment -> user_ (mod_user_id));
489 joinable!(mod_remove_community -> community (community_id));
490 joinable!(mod_remove_community -> user_ (mod_user_id));
491 joinable!(mod_remove_post -> post (post_id));
492 joinable!(mod_remove_post -> user_ (mod_user_id));
493 joinable!(mod_sticky_post -> post (post_id));
494 joinable!(mod_sticky_post -> user_ (mod_user_id));
495 joinable!(password_reset_request -> user_ (user_id));
496 joinable!(post -> community (community_id));
497 joinable!(post -> user_ (creator_id));
498 joinable!(post_like -> post (post_id));
499 joinable!(post_like -> user_ (user_id));
500 joinable!(post_read -> post (post_id));
501 joinable!(post_read -> user_ (user_id));
502 joinable!(post_saved -> post (post_id));
503 joinable!(post_saved -> user_ (user_id));
504 joinable!(site -> user_ (creator_id));
505 joinable!(user_ban -> user_ (user_id));
506 joinable!(user_mention -> comment (comment_id));
507 joinable!(user_mention -> user_ (recipient_id));
508
509 allow_tables_to_appear_in_same_query!(
510   activity,
511   category,
512   comment,
513   comment_aggregates_fast,
514   comment_like,
515   comment_saved,
516   community,
517   community_aggregates_fast,
518   community_follower,
519   community_moderator,
520   community_user_ban,
521   mod_add,
522   mod_add_community,
523   mod_ban,
524   mod_ban_from_community,
525   mod_lock_post,
526   mod_remove_comment,
527   mod_remove_community,
528   mod_remove_post,
529   mod_sticky_post,
530   password_reset_request,
531   post,
532   post_aggregates_fast,
533   post_like,
534   post_read,
535   post_saved,
536   private_message,
537   site,
538   user_,
539   user_ban,
540   user_fast,
541   user_mention,
542 );