]> Untitled Git - lemmy.git/blob - crates/db_schema/src/lib.rs
Remove listing type community. Fixes #2361 (#2377)
[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   TopDay,
34   TopWeek,
35   TopMonth,
36   TopYear,
37   TopAll,
38   MostComments,
39   NewComments,
40 }
41
42 #[derive(EnumString, Display, Debug, Serialize, Deserialize, Clone, Copy, PartialEq)]
43 pub enum ListingType {
44   All,
45   Local,
46   Subscribed,
47 }
48
49 #[derive(EnumString, Display, Debug, Serialize, Deserialize, Clone, Copy)]
50 pub enum SearchType {
51   All,
52   Comments,
53   Posts,
54   Communities,
55   Users,
56   Url,
57 }
58
59 #[derive(EnumString, Display, Debug, PartialEq, Serialize, Deserialize, Clone, Copy)]
60 pub enum SubscribedType {
61   Subscribed,
62   NotSubscribed,
63   Pending,
64 }