1 use crate::newtypes::DbUrl;
2 use serde::{Deserialize, Serialize};
4 #[cfg(feature = "full")]
5 use crate::schema::site;
7 #[derive(PartialEq, Debug, Clone, Serialize, Deserialize)]
8 #[cfg_attr(feature = "full", derive(Queryable, Identifiable))]
9 #[cfg_attr(feature = "full", table_name = "site")]
13 pub sidebar: Option<String>,
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,
23 pub require_email_verification: bool,
24 pub require_application: bool,
25 pub application_question: Option<String>,
26 pub private_instance: bool,
28 pub last_refreshed_at: chrono::NaiveDateTime,
30 pub private_key: Option<String>,
31 pub public_key: String,
32 pub default_theme: String,
33 pub default_post_listing_type: String,
34 pub legal_information: Option<String>,
38 #[cfg_attr(feature = "full", derive(Insertable, AsChangeset))]
39 #[cfg_attr(feature = "full", table_name = "site")]
42 pub sidebar: Option<Option<String>>,
43 pub updated: Option<chrono::NaiveDateTime>,
44 pub enable_downvotes: Option<bool>,
45 pub open_registration: Option<bool>,
46 pub enable_nsfw: Option<bool>,
47 // 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.
48 pub icon: Option<Option<DbUrl>>,
49 pub banner: Option<Option<DbUrl>>,
50 pub description: Option<Option<String>>,
51 pub community_creation_admin_only: Option<bool>,
52 pub require_email_verification: Option<bool>,
53 pub require_application: Option<bool>,
54 pub application_question: Option<Option<String>>,
55 pub private_instance: Option<bool>,
56 pub actor_id: Option<DbUrl>,
57 pub last_refreshed_at: Option<chrono::NaiveDateTime>,
58 pub inbox_url: Option<DbUrl>,
59 pub private_key: Option<Option<String>>,
60 pub public_key: Option<String>,
61 pub default_theme: Option<String>,
62 pub default_post_listing_type: Option<String>,
63 pub legal_information: Option<String>,