2 newtypes::{DbUrl, PersonId},
5 use serde::{Deserialize, Serialize};
7 #[derive(Queryable, Identifiable, PartialEq, Debug, Clone, Serialize, Deserialize)]
12 pub sidebar: Option<String>,
13 pub creator_id: PersonId,
14 pub published: chrono::NaiveDateTime,
15 pub updated: Option<chrono::NaiveDateTime>,
16 pub enable_downvotes: bool,
17 pub open_registration: bool,
18 pub enable_nsfw: bool,
19 pub icon: Option<DbUrl>,
20 pub banner: Option<DbUrl>,
21 pub description: Option<String>,
22 pub community_creation_admin_only: bool,
25 #[derive(Insertable, AsChangeset)]
26 #[table_name = "site"]
29 pub creator_id: PersonId,
30 pub sidebar: Option<Option<String>>,
31 pub updated: Option<chrono::NaiveDateTime>,
32 pub enable_downvotes: Option<bool>,
33 pub open_registration: Option<bool>,
34 pub enable_nsfw: Option<bool>,
35 // 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.
36 pub icon: Option<Option<DbUrl>>,
37 pub banner: Option<Option<DbUrl>>,
38 pub description: Option<Option<String>>,
39 pub community_creation_admin_only: Option<bool>,