]> Untitled Git - lemmy.git/blob - crates/db_schema/src/lib.rs
a859b2aabbed01055c835a18407d1333155180ad
[lemmy.git] / crates / db_schema / src / lib.rs
1 #![recursion_limit = "256"]
2
3 #[cfg(feature = "full")]
4 #[macro_use]
5 extern crate diesel;
6 #[cfg(feature = "full")]
7 #[macro_use]
8 extern crate diesel_derive_newtype;
9 // this is used in tests
10 #[cfg(feature = "full")]
11 #[allow(unused_imports)]
12 #[macro_use]
13 extern crate diesel_migrations;
14
15 pub mod aggregates;
16 #[cfg(feature = "full")]
17 pub mod impls;
18 pub mod newtypes;
19 #[cfg(feature = "full")]
20 pub mod schema;
21 pub mod source;
22 #[cfg(feature = "full")]
23 pub mod traits;
24 #[cfg(feature = "full")]
25 pub mod utils;
26
27 use serde::{Deserialize, Serialize};
28 use strum_macros::{Display, EnumString};
29
30 #[derive(EnumString, Display, Debug, Serialize, Deserialize, Clone, Copy)]
31 pub enum SortType {
32   Active,
33   Hot,
34   New,
35   Old,
36   TopDay,
37   TopWeek,
38   TopMonth,
39   TopYear,
40   TopAll,
41   MostComments,
42   NewComments,
43 }
44
45 #[derive(EnumString, Display, Debug, Serialize, Deserialize, Clone, Copy)]
46 pub enum CommentSortType {
47   Hot,
48   Top,
49   New,
50   Old,
51 }
52
53 #[derive(EnumString, Display, Debug, Serialize, Deserialize, Clone, Copy, PartialEq, Eq)]
54 pub enum ListingType {
55   All,
56   Local,
57   Subscribed,
58 }
59
60 #[derive(EnumString, Display, Debug, Serialize, Deserialize, Clone, Copy)]
61 pub enum SearchType {
62   All,
63   Comments,
64   Posts,
65   Communities,
66   Users,
67   Url,
68 }
69
70 #[derive(EnumString, Display, Debug, PartialEq, Eq, Serialize, Deserialize, Clone, Copy)]
71 pub enum SubscribedType {
72   Subscribed,
73   NotSubscribed,
74   Pending,
75 }
76
77 #[derive(EnumString, Display, Debug, Serialize, Deserialize, Clone, Copy, PartialEq, Eq)]
78 pub enum ModlogActionType {
79   All,
80   ModRemovePost,
81   ModLockPost,
82   ModStickyPost,
83   ModRemoveComment,
84   ModRemoveCommunity,
85   ModBanFromCommunity,
86   ModAddCommunity,
87   ModTransferCommunity,
88   ModAdd,
89   ModBan,
90   ModHideCommunity,
91   AdminPurgePerson,
92   AdminPurgeCommunity,
93   AdminPurgePost,
94   AdminPurgeComment,
95 }