2023-03-20 21:32:31 +00:00
|
|
|
use crate::newtypes::CustomEmojiId;
|
|
|
|
#[cfg(feature = "full")]
|
|
|
|
use crate::schema::custom_emoji_keyword;
|
|
|
|
use serde::{Deserialize, Serialize};
|
2023-04-26 04:26:10 +00:00
|
|
|
#[cfg(feature = "full")]
|
|
|
|
use ts_rs::TS;
|
2023-03-20 21:32:31 +00:00
|
|
|
use typed_builder::TypedBuilder;
|
|
|
|
|
|
|
|
#[derive(PartialEq, Eq, Debug, Clone, Serialize, Deserialize)]
|
2023-04-26 04:26:10 +00:00
|
|
|
#[cfg_attr(feature = "full", derive(Queryable, Associations, Identifiable, TS))]
|
2023-03-20 21:32:31 +00:00
|
|
|
#[cfg_attr(feature = "full", diesel(table_name = custom_emoji_keyword))]
|
|
|
|
#[cfg_attr(
|
|
|
|
feature = "full",
|
|
|
|
diesel(belongs_to(crate::source::custom_emoji::CustomEmoji))
|
|
|
|
)]
|
2023-04-26 04:26:10 +00:00
|
|
|
#[cfg_attr(feature = "full", ts(export))]
|
2023-03-20 21:32:31 +00:00
|
|
|
pub struct CustomEmojiKeyword {
|
|
|
|
pub id: i32,
|
|
|
|
pub custom_emoji_id: CustomEmojiId,
|
|
|
|
pub keyword: String,
|
|
|
|
}
|
|
|
|
|
|
|
|
#[derive(Debug, Clone, TypedBuilder)]
|
|
|
|
#[cfg_attr(feature = "full", derive(Insertable, AsChangeset))]
|
|
|
|
#[cfg_attr(feature = "full", diesel(table_name = custom_emoji_keyword))]
|
|
|
|
pub struct CustomEmojiKeywordInsertForm {
|
|
|
|
pub custom_emoji_id: CustomEmojiId,
|
|
|
|
pub keyword: String,
|
|
|
|
}
|