]> Untitled Git - lemmy.git/blobdiff - crates/db_schema/src/lib.rs
Use same table join code for both read and list functions (#3663)
[lemmy.git] / crates / db_schema / src / lib.rs
index 04ec4e7dab04a40a9009d0ff1d0d2147a2d69bd3..e3232c402e3feb42ab4ddfbb87700eee47d9f822 100644 (file)
@@ -28,6 +28,11 @@ pub mod newtypes;
 #[rustfmt::skip]
 #[allow(clippy::wildcard_imports)]
 pub mod schema;
+#[cfg(feature = "full")]
+pub mod aliases {
+  use crate::schema::person;
+  diesel::alias!(person as person1: Person1, person as person2: Person2);
+}
 pub mod source;
 #[cfg(feature = "full")]
 pub mod traits;
@@ -63,6 +68,10 @@ pub enum SortType {
   TopHour,
   TopSixHour,
   TopTwelveHour,
+  TopThreeMonths,
+  TopSixMonths,
+  TopNineMonths,
+  Controversial,
 }
 
 #[derive(EnumString, Display, Debug, Serialize, Deserialize, Clone, Copy)]
@@ -74,6 +83,20 @@ pub enum CommentSortType {
   Top,
   New,
   Old,
+  Controversial,
+}
+
+#[derive(EnumString, Display, Debug, Serialize, Deserialize, Clone, Copy)]
+#[cfg_attr(feature = "full", derive(TS))]
+#[cfg_attr(feature = "full", ts(export))]
+/// The person sort types. See here for descriptions: https://join-lemmy.org/docs/en/users/03-votes-and-ranking.html
+pub enum PersonSortType {
+  New,
+  Old,
+  MostComments,
+  CommentScore,
+  PostScore,
+  PostCount,
 }
 
 #[derive(EnumString, Display, Debug, Serialize, Deserialize, Clone, Copy, PartialEq, Eq)]