2022-08-18 19:11:19 +00:00
|
|
|
use crate::newtypes::{LanguageId, LocalUserId, LocalUserLanguageId};
|
|
|
|
#[cfg(feature = "full")]
|
|
|
|
use crate::schema::local_user_language;
|
2023-11-21 13:42:28 +00:00
|
|
|
use serde::{Deserialize, Serialize};
|
2022-08-18 19:11:19 +00:00
|
|
|
|
2022-09-26 14:09:32 +00:00
|
|
|
#[derive(Clone, PartialEq, Eq, Debug, Serialize, Deserialize)]
|
2023-11-21 13:42:28 +00:00
|
|
|
#[cfg_attr(feature = "full", derive(Queryable, Selectable, Identifiable))]
|
2022-09-26 14:09:32 +00:00
|
|
|
#[cfg_attr(feature = "full", diesel(table_name = local_user_language))]
|
2023-11-21 13:42:28 +00:00
|
|
|
#[cfg_attr(feature = "full", diesel(check_for_backend(diesel::pg::Pg)))]
|
2022-08-18 19:11:19 +00:00
|
|
|
pub struct LocalUserLanguage {
|
|
|
|
#[serde(skip)]
|
|
|
|
pub id: LocalUserLanguageId,
|
|
|
|
pub local_user_id: LocalUserId,
|
|
|
|
pub language_id: LanguageId,
|
|
|
|
}
|
|
|
|
|
|
|
|
#[derive(Clone)]
|
|
|
|
#[cfg_attr(feature = "full", derive(Insertable, AsChangeset))]
|
2022-09-26 14:09:32 +00:00
|
|
|
#[cfg_attr(feature = "full", diesel(table_name = local_user_language))]
|
2022-08-18 19:11:19 +00:00
|
|
|
pub struct LocalUserLanguageForm {
|
|
|
|
pub local_user_id: LocalUserId,
|
|
|
|
pub language_id: LanguageId,
|
|
|
|
}
|