c9f1407429
* Initial commit to bump diesel to 2.0.0-rc.0 and see what happens * Add chrono feature from diesel * db_schema crate is close to building? * Upgrade diesel-derive-newtype * Mostly modifying references to connections to be mutable ones; also used new way to do migrations as suggested by the migration guide; a lot more compiles now, though I can't figure out this tricky ToSql issue at the moment * Running clippy --fix * Trying to fix drone clippy 1 * Fix clippy * Upgrade clux-musl * Trying to fix drone clippy 2 * Trying to fix drone clippy 3 * Trying to fix drone clippy 5 * Adding diesel table aliases, removing sql view hack. Fixes #2101 Co-authored-by: Steven Chu <stevenc1@gmail.com> Co-authored-by: Nutomic <me@nutomic.com>
93 lines
1.7 KiB
Rust
93 lines
1.7 KiB
Rust
#[cfg(feature = "full")]
|
|
#[macro_use]
|
|
extern crate diesel;
|
|
#[cfg(feature = "full")]
|
|
#[macro_use]
|
|
extern crate diesel_derive_newtype;
|
|
// this is used in tests
|
|
#[cfg(feature = "full")]
|
|
#[allow(unused_imports)]
|
|
#[macro_use]
|
|
extern crate diesel_migrations;
|
|
|
|
pub mod aggregates;
|
|
#[cfg(feature = "full")]
|
|
pub mod impls;
|
|
pub mod newtypes;
|
|
#[cfg(feature = "full")]
|
|
pub mod schema;
|
|
pub mod source;
|
|
#[cfg(feature = "full")]
|
|
pub mod traits;
|
|
#[cfg(feature = "full")]
|
|
pub mod utils;
|
|
|
|
use serde::{Deserialize, Serialize};
|
|
use strum_macros::{Display, EnumString};
|
|
|
|
#[derive(EnumString, Display, Debug, Serialize, Deserialize, Clone, Copy)]
|
|
pub enum SortType {
|
|
Active,
|
|
Hot,
|
|
New,
|
|
Old,
|
|
TopDay,
|
|
TopWeek,
|
|
TopMonth,
|
|
TopYear,
|
|
TopAll,
|
|
MostComments,
|
|
NewComments,
|
|
}
|
|
|
|
#[derive(EnumString, Display, Debug, Serialize, Deserialize, Clone, Copy)]
|
|
pub enum CommentSortType {
|
|
Hot,
|
|
Top,
|
|
New,
|
|
Old,
|
|
}
|
|
|
|
#[derive(EnumString, Display, Debug, Serialize, Deserialize, Clone, Copy, PartialEq, Eq)]
|
|
pub enum ListingType {
|
|
All,
|
|
Local,
|
|
Subscribed,
|
|
}
|
|
|
|
#[derive(EnumString, Display, Debug, Serialize, Deserialize, Clone, Copy)]
|
|
pub enum SearchType {
|
|
All,
|
|
Comments,
|
|
Posts,
|
|
Communities,
|
|
Users,
|
|
Url,
|
|
}
|
|
|
|
#[derive(EnumString, Display, Debug, PartialEq, Eq, Serialize, Deserialize, Clone, Copy)]
|
|
pub enum SubscribedType {
|
|
Subscribed,
|
|
NotSubscribed,
|
|
Pending,
|
|
}
|
|
|
|
#[derive(EnumString, Display, Debug, Serialize, Deserialize, Clone, Copy, PartialEq, Eq)]
|
|
pub enum ModlogActionType {
|
|
All,
|
|
ModRemovePost,
|
|
ModLockPost,
|
|
ModStickyPost,
|
|
ModRemoveComment,
|
|
ModRemoveCommunity,
|
|
ModBanFromCommunity,
|
|
ModAddCommunity,
|
|
ModTransferCommunity,
|
|
ModAdd,
|
|
ModBan,
|
|
ModHideCommunity,
|
|
AdminPurgePerson,
|
|
AdminPurgeCommunity,
|
|
AdminPurgePost,
|
|
AdminPurgeComment,
|
|
}
|