]> Untitled Git - lemmy.git/blob - server/src/schema.rs
Adding emoji support
[lemmy.git] / server / src / schema.rs
1 table! {
2     category (id) {
3         id -> Int4,
4         name -> Varchar,
5     }
6 }
7
8 table! {
9     comment (id) {
10         id -> Int4,
11         creator_id -> Int4,
12         post_id -> Int4,
13         parent_id -> Nullable<Int4>,
14         content -> Text,
15         removed -> Bool,
16         read -> Bool,
17         published -> Timestamp,
18         updated -> Nullable<Timestamp>,
19         deleted -> Bool,
20     }
21 }
22
23 table! {
24     comment_like (id) {
25         id -> Int4,
26         user_id -> Int4,
27         comment_id -> Int4,
28         post_id -> Int4,
29         score -> Int2,
30         published -> Timestamp,
31     }
32 }
33
34 table! {
35     comment_saved (id) {
36         id -> Int4,
37         comment_id -> Int4,
38         user_id -> Int4,
39         published -> Timestamp,
40     }
41 }
42
43 table! {
44     community (id) {
45         id -> Int4,
46         name -> Varchar,
47         title -> Varchar,
48         description -> Nullable<Text>,
49         category_id -> Int4,
50         creator_id -> Int4,
51         removed -> Bool,
52         published -> Timestamp,
53         updated -> Nullable<Timestamp>,
54         deleted -> Bool,
55     }
56 }
57
58 table! {
59     community_follower (id) {
60         id -> Int4,
61         community_id -> Int4,
62         user_id -> Int4,
63         published -> Timestamp,
64     }
65 }
66
67 table! {
68     community_moderator (id) {
69         id -> Int4,
70         community_id -> Int4,
71         user_id -> Int4,
72         published -> Timestamp,
73     }
74 }
75
76 table! {
77     community_user_ban (id) {
78         id -> Int4,
79         community_id -> Int4,
80         user_id -> Int4,
81         published -> Timestamp,
82     }
83 }
84
85 table! {
86     mod_add (id) {
87         id -> Int4,
88         mod_user_id -> Int4,
89         other_user_id -> Int4,
90         removed -> Nullable<Bool>,
91         when_ -> Timestamp,
92     }
93 }
94
95 table! {
96     mod_add_community (id) {
97         id -> Int4,
98         mod_user_id -> Int4,
99         other_user_id -> Int4,
100         community_id -> Int4,
101         removed -> Nullable<Bool>,
102         when_ -> Timestamp,
103     }
104 }
105
106 table! {
107     mod_ban (id) {
108         id -> Int4,
109         mod_user_id -> Int4,
110         other_user_id -> Int4,
111         reason -> Nullable<Text>,
112         banned -> Nullable<Bool>,
113         expires -> Nullable<Timestamp>,
114         when_ -> Timestamp,
115     }
116 }
117
118 table! {
119     mod_ban_from_community (id) {
120         id -> Int4,
121         mod_user_id -> Int4,
122         other_user_id -> Int4,
123         community_id -> Int4,
124         reason -> Nullable<Text>,
125         banned -> Nullable<Bool>,
126         expires -> Nullable<Timestamp>,
127         when_ -> Timestamp,
128     }
129 }
130
131 table! {
132     mod_lock_post (id) {
133         id -> Int4,
134         mod_user_id -> Int4,
135         post_id -> Int4,
136         locked -> Nullable<Bool>,
137         when_ -> Timestamp,
138     }
139 }
140
141 table! {
142     mod_remove_comment (id) {
143         id -> Int4,
144         mod_user_id -> Int4,
145         comment_id -> Int4,
146         reason -> Nullable<Text>,
147         removed -> Nullable<Bool>,
148         when_ -> Timestamp,
149     }
150 }
151
152 table! {
153     mod_remove_community (id) {
154         id -> Int4,
155         mod_user_id -> Int4,
156         community_id -> Int4,
157         reason -> Nullable<Text>,
158         removed -> Nullable<Bool>,
159         expires -> Nullable<Timestamp>,
160         when_ -> Timestamp,
161     }
162 }
163
164 table! {
165     mod_remove_post (id) {
166         id -> Int4,
167         mod_user_id -> Int4,
168         post_id -> Int4,
169         reason -> Nullable<Text>,
170         removed -> Nullable<Bool>,
171         when_ -> Timestamp,
172     }
173 }
174
175 table! {
176     post (id) {
177         id -> Int4,
178         name -> Varchar,
179         url -> Nullable<Text>,
180         body -> Nullable<Text>,
181         creator_id -> Int4,
182         community_id -> Int4,
183         removed -> Bool,
184         locked -> Bool,
185         published -> Timestamp,
186         updated -> Nullable<Timestamp>,
187         deleted -> Bool,
188     }
189 }
190
191 table! {
192     post_like (id) {
193         id -> Int4,
194         post_id -> Int4,
195         user_id -> Int4,
196         score -> Int2,
197         published -> Timestamp,
198     }
199 }
200
201 table! {
202     post_read (id) {
203         id -> Int4,
204         post_id -> Int4,
205         user_id -> Int4,
206         published -> Timestamp,
207     }
208 }
209
210 table! {
211     post_saved (id) {
212         id -> Int4,
213         post_id -> Int4,
214         user_id -> Int4,
215         published -> Timestamp,
216     }
217 }
218
219 table! {
220     site (id) {
221         id -> Int4,
222         name -> Varchar,
223         description -> Nullable<Text>,
224         creator_id -> Int4,
225         published -> Timestamp,
226         updated -> Nullable<Timestamp>,
227     }
228 }
229
230 table! {
231     user_ (id) {
232         id -> Int4,
233         name -> Varchar,
234         fedi_name -> Varchar,
235         preferred_username -> Nullable<Varchar>,
236         password_encrypted -> Text,
237         email -> Nullable<Text>,
238         icon -> Nullable<Bytea>,
239         admin -> Bool,
240         banned -> Bool,
241         published -> Timestamp,
242         updated -> Nullable<Timestamp>,
243     }
244 }
245
246 table! {
247     user_ban (id) {
248         id -> Int4,
249         user_id -> Int4,
250         published -> Timestamp,
251     }
252 }
253
254 joinable!(comment -> post (post_id));
255 joinable!(comment -> user_ (creator_id));
256 joinable!(comment_like -> comment (comment_id));
257 joinable!(comment_like -> post (post_id));
258 joinable!(comment_like -> user_ (user_id));
259 joinable!(comment_saved -> comment (comment_id));
260 joinable!(comment_saved -> user_ (user_id));
261 joinable!(community -> category (category_id));
262 joinable!(community -> user_ (creator_id));
263 joinable!(community_follower -> community (community_id));
264 joinable!(community_follower -> user_ (user_id));
265 joinable!(community_moderator -> community (community_id));
266 joinable!(community_moderator -> user_ (user_id));
267 joinable!(community_user_ban -> community (community_id));
268 joinable!(community_user_ban -> user_ (user_id));
269 joinable!(mod_add_community -> community (community_id));
270 joinable!(mod_ban_from_community -> community (community_id));
271 joinable!(mod_lock_post -> post (post_id));
272 joinable!(mod_lock_post -> user_ (mod_user_id));
273 joinable!(mod_remove_comment -> comment (comment_id));
274 joinable!(mod_remove_comment -> user_ (mod_user_id));
275 joinable!(mod_remove_community -> community (community_id));
276 joinable!(mod_remove_community -> user_ (mod_user_id));
277 joinable!(mod_remove_post -> post (post_id));
278 joinable!(mod_remove_post -> user_ (mod_user_id));
279 joinable!(post -> community (community_id));
280 joinable!(post -> user_ (creator_id));
281 joinable!(post_like -> post (post_id));
282 joinable!(post_like -> user_ (user_id));
283 joinable!(post_read -> post (post_id));
284 joinable!(post_read -> user_ (user_id));
285 joinable!(post_saved -> post (post_id));
286 joinable!(post_saved -> user_ (user_id));
287 joinable!(site -> user_ (creator_id));
288 joinable!(user_ban -> user_ (user_id));
289
290 allow_tables_to_appear_in_same_query!(
291     category,
292     comment,
293     comment_like,
294     comment_saved,
295     community,
296     community_follower,
297     community_moderator,
298     community_user_ban,
299     mod_add,
300     mod_add_community,
301     mod_ban,
302     mod_ban_from_community,
303     mod_lock_post,
304     mod_remove_comment,
305     mod_remove_community,
306     mod_remove_post,
307     post,
308     post_like,
309     post_read,
310     post_saved,
311     site,
312     user_,
313     user_ban,
314 );