mirror of
https://github.com/LemmyNet/lemmy.git
synced 2024-12-22 19:01:32 +00:00
Fix
This commit is contained in:
parent
dada964df7
commit
031dc2607e
1 changed files with 27 additions and 0 deletions
27
crates/db_schema/src/source/combined/search.rs
Normal file
27
crates/db_schema/src/source/combined/search.rs
Normal file
|
@ -0,0 +1,27 @@
|
|||
use crate::newtypes::{CommentId, CommunityId, PersonId, PostId, SearchCombinedId};
|
||||
#[cfg(feature = "full")]
|
||||
use crate::schema::search_combined;
|
||||
use chrono::{DateTime, Utc};
|
||||
#[cfg(feature = "full")]
|
||||
use i_love_jesus::CursorKeysModule;
|
||||
use serde::{Deserialize, Serialize};
|
||||
use serde_with::skip_serializing_none;
|
||||
|
||||
#[skip_serializing_none]
|
||||
#[derive(PartialEq, Eq, Serialize, Deserialize, Debug, Clone)]
|
||||
#[cfg_attr(
|
||||
feature = "full",
|
||||
derive(Identifiable, Queryable, Selectable, CursorKeysModule)
|
||||
)]
|
||||
#[cfg_attr(feature = "full", diesel(table_name = search_combined))]
|
||||
#[cfg_attr(feature = "full", diesel(check_for_backend(diesel::pg::Pg)))]
|
||||
#[cfg_attr(feature = "full", cursor_keys_module(name = search_combined_keys))]
|
||||
/// A combined table for a search (posts, comments, communities, persons)
|
||||
pub struct SearchCombined {
|
||||
pub id: SearchCombinedId,
|
||||
pub published: DateTime<Utc>,
|
||||
pub post_id: Option<PostId>,
|
||||
pub comment_id: Option<CommentId>,
|
||||
pub community_id: Option<CommunityId>,
|
||||
pub person_id: Option<PersonId>,
|
||||
}
|
Loading…
Reference in a new issue