]> Untitled Git - lemmy.git/blobdiff - crates/db_schema/src/source/registration_application.rs
Diesel 2.0.0 upgrade (#2452)
[lemmy.git] / crates / db_schema / src / source / registration_application.rs
index 01f702d8183f6b6d0a6468ff7994ab6c52d1b9c4..ecf4eb3e875d116381f80d6539ea7983d8dc26cd 100644 (file)
@@ -1,11 +1,12 @@
-use crate::{
-  newtypes::{LocalUserId, PersonId},
-  schema::registration_application,
-};
+use crate::newtypes::{LocalUserId, PersonId};
 use serde::{Deserialize, Serialize};
 
-#[derive(Clone, Queryable, Identifiable, PartialEq, Debug, Serialize, Deserialize)]
-#[table_name = "registration_application"]
+#[cfg(feature = "full")]
+use crate::schema::registration_application;
+
+#[derive(Clone, PartialEq, Eq, Debug, Serialize, Deserialize)]
+#[cfg_attr(feature = "full", derive(Queryable, Identifiable))]
+#[cfg_attr(feature = "full", diesel(table_name = registration_application))]
 pub struct RegistrationApplication {
   pub id: i32,
   pub local_user_id: LocalUserId,
@@ -15,8 +16,9 @@ pub struct RegistrationApplication {
   pub published: chrono::NaiveDateTime,
 }
 
-#[derive(Insertable, AsChangeset, Default)]
-#[table_name = "registration_application"]
+#[derive(Default)]
+#[cfg_attr(feature = "full", derive(Insertable, AsChangeset))]
+#[cfg_attr(feature = "full", diesel(table_name = registration_application))]
 pub struct RegistrationApplicationForm {
   pub local_user_id: Option<LocalUserId>,
   pub answer: Option<String>,