1 use crate::{schema::site, DbUrl, PersonId};
4 #[derive(Queryable, Identifiable, PartialEq, Debug, Clone, Serialize)]
9 pub sidebar: Option<String>,
10 pub creator_id: PersonId,
11 pub published: chrono::NaiveDateTime,
12 pub updated: Option<chrono::NaiveDateTime>,
13 pub enable_downvotes: bool,
14 pub open_registration: bool,
15 pub enable_nsfw: bool,
16 pub icon: Option<DbUrl>,
17 pub banner: Option<DbUrl>,
18 pub description: Option<String>,
21 #[derive(Insertable, AsChangeset)]
22 #[table_name = "site"]
25 pub sidebar: Option<Option<String>>,
26 pub creator_id: PersonId,
27 pub updated: Option<chrono::NaiveDateTime>,
28 pub enable_downvotes: bool,
29 pub open_registration: bool,
30 pub enable_nsfw: bool,
31 // when you want to null out a column, you have to send Some(None)), since sending None means you just don't want to update that column.
32 pub icon: Option<Option<DbUrl>>,
33 pub banner: Option<Option<DbUrl>>,
34 pub description: Option<Option<String>>,