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