]> Untitled Git - lemmy.git/blob - crates/db_schema/src/source/tagline.rs
Add support for Taglines (#2548)
[lemmy.git] / crates / db_schema / src / source / tagline.rs
1 use crate::newtypes::LocalSiteId;
2 #[cfg(feature = "full")]
3 use crate::schema::tagline;
4 use serde::{Deserialize, Serialize};
5
6 #[derive(PartialEq, Eq, Debug, Clone, Serialize, Deserialize)]
7 #[cfg_attr(feature = "full", derive(Queryable, Associations, Identifiable))]
8 #[cfg_attr(feature = "full", diesel(table_name = tagline))]
9 #[cfg_attr(
10   feature = "full",
11   diesel(belongs_to(crate::source::local_site::LocalSite))
12 )]
13 pub struct Tagline {
14   pub id: i32,
15   pub local_site_id: LocalSiteId,
16   pub content: String,
17   pub published: chrono::NaiveDateTime,
18   pub updated: Option<chrono::NaiveDateTime>,
19 }
20
21 #[derive(Clone, Default)]
22 #[cfg_attr(feature = "full", derive(Insertable, AsChangeset))]
23 #[cfg_attr(feature = "full", diesel(table_name = tagline))]
24 pub struct TaglineForm {
25   pub local_site_id: LocalSiteId,
26   pub content: String,
27   pub updated: Option<chrono::NaiveDateTime>,
28 }