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,
37 #[cfg_attr(feature = "full", derive(Insertable, AsChangeset))]
38 #[cfg_attr(feature = "full", table_name = "site")]
41 pub sidebar: Option<Option<String>>,
42 pub updated: Option<chrono::NaiveDateTime>,
43 pub enable_downvotes: Option<bool>,
44 pub open_registration: Option<bool>,
45 pub enable_nsfw: Option<bool>,
46 // 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.
47 pub icon: Option<Option<DbUrl>>,
48 pub banner: Option<Option<DbUrl>>,
49 pub description: Option<Option<String>>,
50 pub community_creation_admin_only: Option<bool>,
51 pub require_email_verification: Option<bool>,
52 pub require_application: Option<bool>,
53 pub application_question: Option<Option<String>>,
54 pub private_instance: Option<bool>,
55 pub actor_id: Option<DbUrl>,
56 pub last_refreshed_at: Option<chrono::NaiveDateTime>,
57 pub inbox_url: Option<DbUrl>,
58 pub private_key: Option<Option<String>>,
59 pub public_key: Option<String>,
60 pub default_theme: Option<String>,
61 pub default_post_listing_type: Option<String>,