]> Untitled Git - lemmy.git/blob - crates/db_schema/src/source/actor_language.rs
Split activity table into sent and received parts (fixes #3103) (#3583)
[lemmy.git] / crates / db_schema / src / source / actor_language.rs
1 use crate::newtypes::{
2   CommunityId,
3   CommunityLanguageId,
4   LanguageId,
5   LocalUserId,
6   LocalUserLanguageId,
7   SiteId,
8   SiteLanguageId,
9 };
10 #[cfg(feature = "full")]
11 use crate::schema::local_user_language;
12 use serde::{Deserialize, Serialize};
13
14 #[derive(Clone, PartialEq, Eq, Debug, Serialize, Deserialize)]
15 #[cfg_attr(feature = "full", derive(Queryable, Identifiable))]
16 #[cfg_attr(feature = "full", diesel(table_name = local_user_language))]
17 pub struct LocalUserLanguage {
18   #[serde(skip)]
19   pub id: LocalUserLanguageId,
20   pub local_user_id: LocalUserId,
21   pub language_id: LanguageId,
22 }
23
24 #[derive(Clone)]
25 #[cfg_attr(feature = "full", derive(Insertable, AsChangeset))]
26 #[cfg_attr(feature = "full", diesel(table_name = local_user_language))]
27 pub struct LocalUserLanguageForm {
28   pub local_user_id: LocalUserId,
29   pub language_id: LanguageId,
30 }
31
32 #[cfg(feature = "full")]
33 use crate::schema::community_language;
34
35 #[derive(Clone, PartialEq, Eq, Debug, Serialize, Deserialize)]
36 #[cfg_attr(feature = "full", derive(Queryable, Identifiable))]
37 #[cfg_attr(feature = "full", diesel(table_name = community_language))]
38 pub struct CommunityLanguage {
39   #[serde(skip)]
40   pub id: CommunityLanguageId,
41   pub community_id: CommunityId,
42   pub language_id: LanguageId,
43 }
44
45 #[derive(Clone)]
46 #[cfg_attr(feature = "full", derive(Insertable, AsChangeset))]
47 #[cfg_attr(feature = "full", diesel(table_name = community_language))]
48 pub struct CommunityLanguageForm {
49   pub community_id: CommunityId,
50   pub language_id: LanguageId,
51 }
52
53 #[cfg(feature = "full")]
54 use crate::schema::site_language;
55
56 #[derive(Clone, PartialEq, Eq, Debug, Serialize, Deserialize)]
57 #[cfg_attr(feature = "full", derive(Queryable, Identifiable))]
58 #[cfg_attr(feature = "full", diesel(table_name = site_language))]
59 pub struct SiteLanguage {
60   #[serde(skip)]
61   pub id: SiteLanguageId,
62   pub site_id: SiteId,
63   pub language_id: LanguageId,
64 }
65
66 #[derive(Clone, Debug)]
67 #[cfg_attr(feature = "full", derive(Insertable, AsChangeset))]
68 #[cfg_attr(feature = "full", diesel(table_name = site_language))]
69 pub struct SiteLanguageForm {
70   pub site_id: SiteId,
71   pub language_id: LanguageId,
72 }