]> Untitled Git - lemmy.git/blob - crates/db_schema/src/lib.rs
Expose pending 2 (#2282)
[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   Community,
48 }
49
50 #[derive(EnumString, Display, Debug, Serialize, Deserialize, Clone, Copy)]
51 pub enum SearchType {
52   All,
53   Comments,
54   Posts,
55   Communities,
56   Users,
57   Url,
58 }
59
60 #[derive(EnumString, Display, Debug, PartialEq, Serialize, Deserialize, Clone, Copy)]
61 pub enum SubscribedType {
62   Subscribed,
63   NotSubscribed,
64   Pending,
65 }