mirror of
https://github.com/LemmyNet/lemmy.git
synced 2024-10-31 17:50:01 +00:00
cb753b045f
* Group imports with rustfmt * Running cargo fmt again. Co-authored-by: Felix Ableitner <me@nutomic.com>
25 lines
848 B
Rust
25 lines
848 B
Rust
use crate::newtypes::{CommunityBlockId, CommunityId, PersonId};
|
|
#[cfg(feature = "full")]
|
|
use crate::schema::community_block;
|
|
use serde::{Deserialize, Serialize};
|
|
|
|
#[derive(Clone, PartialEq, Eq, Debug, Serialize, Deserialize)]
|
|
#[cfg_attr(feature = "full", derive(Queryable, Associations, Identifiable))]
|
|
#[cfg_attr(
|
|
feature = "full",
|
|
diesel(belongs_to(crate::source::community::Community))
|
|
)]
|
|
#[cfg_attr(feature = "full", diesel(table_name = community_block))]
|
|
pub struct CommunityBlock {
|
|
pub id: CommunityBlockId,
|
|
pub person_id: PersonId,
|
|
pub community_id: CommunityId,
|
|
pub published: chrono::NaiveDateTime,
|
|
}
|
|
|
|
#[cfg_attr(feature = "full", derive(Insertable, AsChangeset))]
|
|
#[cfg_attr(feature = "full", diesel(table_name = community_block))]
|
|
pub struct CommunityBlockForm {
|
|
pub person_id: PersonId,
|
|
pub community_id: CommunityId,
|
|
}
|