From 031dc2607e036f60ad7f52ad98889b3842111d3e Mon Sep 17 00:00:00 2001 From: Dessalines Date: Thu, 12 Dec 2024 19:13:51 -0500 Subject: [PATCH] Fix --- .../db_schema/src/source/combined/search.rs | 27 +++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 crates/db_schema/src/source/combined/search.rs diff --git a/crates/db_schema/src/source/combined/search.rs b/crates/db_schema/src/source/combined/search.rs new file mode 100644 index 000000000..f5b2f9a5d --- /dev/null +++ b/crates/db_schema/src/source/combined/search.rs @@ -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, + pub post_id: Option, + pub comment_id: Option, + pub community_id: Option, + pub person_id: Option, +}