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