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