]> Untitled Git - lemmy.git/blob - crates/db_schema/src/source/instance.rs
Fixing slow joins to post_read, post_saved, and comment_saved . (#2738)
[lemmy.git] / crates / db_schema / src / source / instance.rs
1 use crate::newtypes::InstanceId;
2 #[cfg(feature = "full")]
3 use crate::schema::instance;
4 use std::fmt::Debug;
5
6 #[derive(PartialEq, Eq, Debug)]
7 #[cfg_attr(feature = "full", derive(Queryable, Identifiable))]
8 #[cfg_attr(feature = "full", diesel(table_name = instance))]
9 pub struct Instance {
10   pub id: InstanceId,
11   pub domain: String,
12   pub published: chrono::NaiveDateTime,
13   pub updated: Option<chrono::NaiveDateTime>,
14 }
15
16 #[cfg_attr(feature = "full", derive(Insertable, AsChangeset))]
17 #[cfg_attr(feature = "full", diesel(table_name = instance))]
18 pub struct InstanceForm {
19   pub domain: String,
20   pub updated: Option<chrono::NaiveDateTime>,
21 }