]> Untitled Git - lemmy.git/blob - crates/db_schema/src/source/tagline.rs
Automatically resolve report when post/comment is removed (#3850)
[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 use serde_with::skip_serializing_none;
6 #[cfg(feature = "full")]
7 use ts_rs::TS;
8
9 #[skip_serializing_none]
10 #[derive(PartialEq, Eq, Debug, Clone, Serialize, Deserialize)]
11 #[cfg_attr(feature = "full", derive(Queryable, Associations, Identifiable, TS))]
12 #[cfg_attr(feature = "full", diesel(table_name = tagline))]
13 #[cfg_attr(
14   feature = "full",
15   diesel(belongs_to(crate::source::local_site::LocalSite))
16 )]
17 #[cfg_attr(feature = "full", ts(export))]
18 /// A tagline, shown at the top of your site.
19 pub struct Tagline {
20   pub id: i32,
21   pub local_site_id: LocalSiteId,
22   pub content: String,
23   pub published: chrono::NaiveDateTime,
24   pub updated: Option<chrono::NaiveDateTime>,
25 }
26
27 #[derive(Clone, Default)]
28 #[cfg_attr(feature = "full", derive(Insertable, AsChangeset))]
29 #[cfg_attr(feature = "full", diesel(table_name = tagline))]
30 pub struct TaglineForm {
31   pub local_site_id: LocalSiteId,
32   pub content: String,
33   pub updated: Option<chrono::NaiveDateTime>,
34 }