Add WithoutId derives

This commit is contained in:
dullbananas 2023-07-31 20:15:10 -07:00 committed by GitHub
parent 5e86922b0f
commit 06006d6ad3
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
16 changed files with 17 additions and 17 deletions

View file

@ -13,7 +13,7 @@ use typed_builder::TypedBuilder;
#[skip_serializing_none] #[skip_serializing_none]
#[derive(Clone, PartialEq, Eq, Debug, Serialize, Deserialize)] #[derive(Clone, PartialEq, Eq, Debug, Serialize, Deserialize)]
#[cfg_attr(feature = "full", derive(Queryable, Associations, Identifiable, TS))] #[cfg_attr(feature = "full", derive(Queryable, Associations, Identifiable, TS, WithoutId!))]
#[cfg_attr(feature = "full", ts(export))] #[cfg_attr(feature = "full", ts(export))]
#[cfg_attr(feature = "full", diesel(belongs_to(crate::source::post::Post)))] #[cfg_attr(feature = "full", diesel(belongs_to(crate::source::post::Post)))]
#[cfg_attr(feature = "full", diesel(table_name = comment))] #[cfg_attr(feature = "full", diesel(table_name = comment))]

View file

@ -6,7 +6,7 @@ use serde::{Deserialize, Serialize};
use ts_rs::TS; use ts_rs::TS;
#[derive(Clone, PartialEq, Eq, Debug, Serialize, Deserialize)] #[derive(Clone, PartialEq, Eq, Debug, Serialize, Deserialize)]
#[cfg_attr(feature = "full", derive(Queryable, Associations, Identifiable, TS))] #[cfg_attr(feature = "full", derive(Queryable, Associations, Identifiable, TS, WithoutId!))]
#[cfg_attr(feature = "full", diesel(belongs_to(crate::source::comment::Comment)))] #[cfg_attr(feature = "full", diesel(belongs_to(crate::source::comment::Comment)))]
#[cfg_attr(feature = "full", diesel(table_name = comment_reply))] #[cfg_attr(feature = "full", diesel(table_name = comment_reply))]
#[cfg_attr(feature = "full", ts(export))] #[cfg_attr(feature = "full", ts(export))]

View file

@ -8,7 +8,7 @@ use ts_rs::TS;
#[skip_serializing_none] #[skip_serializing_none]
#[derive(PartialEq, Eq, Serialize, Deserialize, Debug, Clone)] #[derive(PartialEq, Eq, Serialize, Deserialize, Debug, Clone)]
#[cfg_attr(feature = "full", derive(Queryable, Associations, Identifiable, TS))] #[cfg_attr(feature = "full", derive(Queryable, Associations, Identifiable, TS, WithoutId!))]
#[cfg_attr(feature = "full", diesel(belongs_to(crate::source::comment::Comment)))] #[cfg_attr(feature = "full", diesel(belongs_to(crate::source::comment::Comment)))]
#[cfg_attr(feature = "full", diesel(table_name = comment_report))] #[cfg_attr(feature = "full", diesel(table_name = comment_report))]
#[cfg_attr(feature = "full", ts(export))] #[cfg_attr(feature = "full", ts(export))]

View file

@ -11,7 +11,7 @@ use ts_rs::TS;
use typed_builder::TypedBuilder; use typed_builder::TypedBuilder;
#[skip_serializing_none] #[skip_serializing_none]
#[derive(Clone, PartialEq, Eq, Debug, Serialize, Deserialize)] #[derive(Clone, PartialEq, Eq, Debug, Serialize, Deserialize, WithoutId!)]
#[cfg_attr(feature = "full", derive(Queryable, Identifiable, TS))] #[cfg_attr(feature = "full", derive(Queryable, Identifiable, TS))]
#[cfg_attr(feature = "full", diesel(table_name = community))] #[cfg_attr(feature = "full", diesel(table_name = community))]
#[cfg_attr(feature = "full", ts(export))] #[cfg_attr(feature = "full", ts(export))]
@ -126,7 +126,7 @@ pub struct CommunityUpdateForm {
} }
#[derive(PartialEq, Eq, Debug)] #[derive(PartialEq, Eq, Debug)]
#[cfg_attr(feature = "full", derive(Identifiable, Queryable, Associations))] #[cfg_attr(feature = "full", derive(Identifiable, Queryable, Associations, WithoutId!))]
#[cfg_attr( #[cfg_attr(
feature = "full", feature = "full",
diesel(belongs_to(crate::source::community::Community)) diesel(belongs_to(crate::source::community::Community))

View file

@ -9,7 +9,7 @@ use typed_builder::TypedBuilder;
#[skip_serializing_none] #[skip_serializing_none]
#[derive(PartialEq, Eq, Debug, Clone, Serialize, Deserialize)] #[derive(PartialEq, Eq, Debug, Clone, Serialize, Deserialize)]
#[cfg_attr(feature = "full", derive(Queryable, Associations, Identifiable, TS))] #[cfg_attr(feature = "full", derive(Queryable, Associations, Identifiable, TS, WithoutId!))]
#[cfg_attr(feature = "full", diesel(table_name = custom_emoji))] #[cfg_attr(feature = "full", diesel(table_name = custom_emoji))]
#[cfg_attr( #[cfg_attr(
feature = "full", feature = "full",

View file

@ -7,7 +7,7 @@ use ts_rs::TS;
use typed_builder::TypedBuilder; use typed_builder::TypedBuilder;
#[derive(PartialEq, Eq, Debug, Clone, Serialize, Deserialize)] #[derive(PartialEq, Eq, Debug, Clone, Serialize, Deserialize)]
#[cfg_attr(feature = "full", derive(Queryable, Associations, Identifiable, TS))] #[cfg_attr(feature = "full", derive(Queryable, Associations, Identifiable, TS, WithoutId!))]
#[cfg_attr(feature = "full", diesel(table_name = custom_emoji_keyword))] #[cfg_attr(feature = "full", diesel(table_name = custom_emoji_keyword))]
#[cfg_attr( #[cfg_attr(
feature = "full", feature = "full",

View file

@ -13,7 +13,7 @@ use typed_builder::TypedBuilder;
#[skip_serializing_none] #[skip_serializing_none]
#[derive(PartialEq, Eq, Debug, Clone, Serialize, Deserialize)] #[derive(PartialEq, Eq, Debug, Clone, Serialize, Deserialize)]
#[cfg_attr(feature = "full", derive(Queryable, Identifiable, TS))] #[cfg_attr(feature = "full", derive(Queryable, Identifiable, TS, WithoutId!))]
#[cfg_attr(feature = "full", diesel(table_name = local_site))] #[cfg_attr(feature = "full", diesel(table_name = local_site))]
#[cfg_attr(feature = "full", diesel(belongs_to(crate::source::site::Site)))] #[cfg_attr(feature = "full", diesel(belongs_to(crate::source::site::Site)))]
#[cfg_attr(feature = "full", ts(export))] #[cfg_attr(feature = "full", ts(export))]

View file

@ -9,7 +9,7 @@ use typed_builder::TypedBuilder;
#[skip_serializing_none] #[skip_serializing_none]
#[derive(PartialEq, Eq, Debug, Clone, Serialize, Deserialize)] #[derive(PartialEq, Eq, Debug, Clone, Serialize, Deserialize)]
#[cfg_attr(feature = "full", derive(Queryable, Identifiable, TS))] #[cfg_attr(feature = "full", derive(Queryable, Identifiable, TS, WithoutId!))]
#[cfg_attr(feature = "full", diesel(table_name = local_site_rate_limit))] #[cfg_attr(feature = "full", diesel(table_name = local_site_rate_limit))]
#[cfg_attr( #[cfg_attr(
feature = "full", feature = "full",

View file

@ -13,7 +13,7 @@ use typed_builder::TypedBuilder;
#[skip_serializing_none] #[skip_serializing_none]
#[derive(Clone, PartialEq, Eq, Debug, Serialize, Deserialize)] #[derive(Clone, PartialEq, Eq, Debug, Serialize, Deserialize)]
#[cfg_attr(feature = "full", derive(Queryable, Identifiable, TS))] #[cfg_attr(feature = "full", derive(Queryable, Identifiable, TS, WithoutId!))]
#[cfg_attr(feature = "full", diesel(table_name = local_user))] #[cfg_attr(feature = "full", diesel(table_name = local_user))]
#[cfg_attr(feature = "full", ts(export))] #[cfg_attr(feature = "full", ts(export))]
/// A local user. /// A local user.

View file

@ -12,7 +12,7 @@ use typed_builder::TypedBuilder;
#[skip_serializing_none] #[skip_serializing_none]
#[derive(Clone, PartialEq, Eq, Debug, Serialize, Deserialize)] #[derive(Clone, PartialEq, Eq, Debug, Serialize, Deserialize)]
#[cfg_attr(feature = "full", derive(Queryable, Identifiable, TS))] #[cfg_attr(feature = "full", derive(Queryable, Identifiable, TS, WithoutId!))]
#[cfg_attr(feature = "full", diesel(table_name = person))] #[cfg_attr(feature = "full", diesel(table_name = person))]
#[cfg_attr(feature = "full", ts(export))] #[cfg_attr(feature = "full", ts(export))]
/// A person. /// A person.

View file

@ -6,7 +6,7 @@ use serde::{Deserialize, Serialize};
use ts_rs::TS; use ts_rs::TS;
#[derive(Clone, PartialEq, Eq, Debug, Serialize, Deserialize)] #[derive(Clone, PartialEq, Eq, Debug, Serialize, Deserialize)]
#[cfg_attr(feature = "full", derive(Queryable, Associations, Identifiable, TS))] #[cfg_attr(feature = "full", derive(Queryable, Associations, Identifiable, TS, WithoutId!))]
#[cfg_attr(feature = "full", diesel(belongs_to(crate::source::comment::Comment)))] #[cfg_attr(feature = "full", diesel(belongs_to(crate::source::comment::Comment)))]
#[cfg_attr(feature = "full", diesel(table_name = person_mention))] #[cfg_attr(feature = "full", diesel(table_name = person_mention))]
#[cfg_attr(feature = "full", ts(export))] #[cfg_attr(feature = "full", ts(export))]

View file

@ -9,7 +9,7 @@ use typed_builder::TypedBuilder;
#[skip_serializing_none] #[skip_serializing_none]
#[derive(Clone, PartialEq, Eq, Debug, Serialize, Deserialize)] #[derive(Clone, PartialEq, Eq, Debug, Serialize, Deserialize)]
#[cfg_attr(feature = "full", derive(Queryable, Identifiable, TS))] #[cfg_attr(feature = "full", derive(Queryable, Identifiable, TS, WithoutId!))]
#[cfg_attr(feature = "full", diesel(table_name = post))] #[cfg_attr(feature = "full", diesel(table_name = post))]
#[cfg_attr(feature = "full", ts(export))] #[cfg_attr(feature = "full", ts(export))]
/// A post. /// A post.

View file

@ -8,7 +8,7 @@ use ts_rs::TS;
#[skip_serializing_none] #[skip_serializing_none]
#[derive(PartialEq, Eq, Serialize, Deserialize, Debug, Clone)] #[derive(PartialEq, Eq, Serialize, Deserialize, Debug, Clone)]
#[cfg_attr(feature = "full", derive(Identifiable, Queryable, Associations, TS))] #[cfg_attr(feature = "full", derive(Identifiable, Queryable, Associations, TS, WithoutId!))]
#[cfg_attr(feature = "full", diesel(belongs_to(crate::source::post::Post)))] // Is this the right assoc? #[cfg_attr(feature = "full", diesel(belongs_to(crate::source::post::Post)))] // Is this the right assoc?
#[cfg_attr(feature = "full", diesel(table_name = post_report))] #[cfg_attr(feature = "full", diesel(table_name = post_report))]
#[cfg_attr(feature = "full", ts(export))] #[cfg_attr(feature = "full", ts(export))]

View file

@ -9,7 +9,7 @@ use typed_builder::TypedBuilder;
#[skip_serializing_none] #[skip_serializing_none]
#[derive(Clone, PartialEq, Eq, Debug, Serialize, Deserialize)] #[derive(Clone, PartialEq, Eq, Debug, Serialize, Deserialize)]
#[cfg_attr(feature = "full", derive(Queryable, Associations, Identifiable, TS))] #[cfg_attr(feature = "full", derive(Queryable, Associations, Identifiable, TS, WithoutId!))]
#[cfg_attr( #[cfg_attr(
feature = "full", feature = "full",
diesel(belongs_to(crate::source::person::Person, foreign_key = creator_id) diesel(belongs_to(crate::source::person::Person, foreign_key = creator_id)

View file

@ -8,7 +8,7 @@ use ts_rs::TS;
#[skip_serializing_none] #[skip_serializing_none]
#[derive(PartialEq, Eq, Serialize, Deserialize, Debug, Clone)] #[derive(PartialEq, Eq, Serialize, Deserialize, Debug, Clone)]
#[cfg_attr(feature = "full", derive(Queryable, Associations, Identifiable, TS))] #[cfg_attr(feature = "full", derive(Queryable, Associations, Identifiable, TS, WithoutId!))]
#[cfg_attr( #[cfg_attr(
feature = "full", feature = "full",
diesel(belongs_to(crate::source::private_message::PrivateMessage)) diesel(belongs_to(crate::source::private_message::PrivateMessage))

View file

@ -10,7 +10,7 @@ use typed_builder::TypedBuilder;
#[skip_serializing_none] #[skip_serializing_none]
#[derive(PartialEq, Eq, Debug, Clone, Serialize, Deserialize)] #[derive(PartialEq, Eq, Debug, Clone, Serialize, Deserialize)]
#[cfg_attr(feature = "full", derive(Queryable, Identifiable, TS))] #[cfg_attr(feature = "full", derive(Queryable, Identifiable, TS, WithoutId!))]
#[cfg_attr(feature = "full", diesel(table_name = site))] #[cfg_attr(feature = "full", diesel(table_name = site))]
#[cfg_attr(feature = "full", ts(export))] #[cfg_attr(feature = "full", ts(export))]
/// The site. /// The site.