1 use crate::newtypes::{CustomEmojiId, DbUrl, LocalSiteId};
2 #[cfg(feature = "full")]
3 use crate::schema::custom_emoji;
4 use serde::{Deserialize, Serialize};
5 use serde_with::skip_serializing_none;
6 #[cfg(feature = "full")]
8 use typed_builder::TypedBuilder;
10 #[skip_serializing_none]
11 #[derive(PartialEq, Eq, Debug, Clone, Serialize, Deserialize)]
12 #[cfg_attr(feature = "full", derive(Queryable, Associations, Identifiable, TS))]
13 #[cfg_attr(feature = "full", diesel(table_name = custom_emoji))]
16 diesel(belongs_to(crate::source::local_site::LocalSite))
18 #[cfg_attr(feature = "full", ts(export))]
20 pub struct CustomEmoji {
21 pub id: CustomEmojiId,
22 pub local_site_id: LocalSiteId,
23 pub shortcode: String,
27 pub published: chrono::NaiveDateTime,
28 pub updated: Option<chrono::NaiveDateTime>,
31 #[derive(Debug, Clone, TypedBuilder)]
32 #[cfg_attr(feature = "full", derive(Insertable, AsChangeset))]
33 #[cfg_attr(feature = "full", diesel(table_name = custom_emoji))]
34 pub struct CustomEmojiInsertForm {
35 pub local_site_id: LocalSiteId,
36 pub shortcode: String,
42 #[derive(Debug, Clone, TypedBuilder)]
43 #[cfg_attr(feature = "full", derive(Insertable, AsChangeset))]
44 #[cfg_attr(feature = "full", diesel(table_name = custom_emoji))]
45 pub struct CustomEmojiUpdateForm {
46 pub local_site_id: LocalSiteId,