//! `SeaORM` Entity. Generated by sea-orm-codegen 0.10.7 use super::sea_orm_active_enums::NotificationTypeEnum; use sea_orm::entity::prelude::*; #[derive(Clone, Debug, PartialEq, DeriveEntityModel, Eq)] #[sea_orm(table_name = "notification")] pub struct Model { #[sea_orm(primary_key, auto_increment = false)] pub id: String, #[sea_orm(column_name = "createdAt")] pub created_at: DateTimeWithTimeZone, #[sea_orm(column_name = "notifieeId")] pub notifiee_id: String, #[sea_orm(column_name = "notifierId")] pub notifier_id: Option, #[sea_orm(column_name = "isRead")] pub is_read: bool, #[sea_orm(column_name = "noteId")] pub note_id: Option, pub reaction: Option, pub choice: Option, #[sea_orm(column_name = "followRequestId")] pub follow_request_id: Option, pub r#type: NotificationTypeEnum, #[sea_orm(column_name = "userGroupInvitationId")] pub user_group_invitation_id: Option, #[sea_orm(column_name = "customBody")] pub custom_body: Option, #[sea_orm(column_name = "customHeader")] pub custom_header: Option, #[sea_orm(column_name = "customIcon")] pub custom_icon: Option, #[sea_orm(column_name = "appAccessTokenId")] pub app_access_token_id: Option, } #[derive(Copy, Clone, Debug, EnumIter, DeriveRelation)] pub enum Relation { #[sea_orm( belongs_to = "super::access_token::Entity", from = "Column::AppAccessTokenId", to = "super::access_token::Column::Id", on_update = "NoAction", on_delete = "Cascade" )] AccessToken, #[sea_orm( belongs_to = "super::follow_request::Entity", from = "Column::FollowRequestId", to = "super::follow_request::Column::Id", on_update = "NoAction", on_delete = "Cascade" )] FollowRequest, #[sea_orm( belongs_to = "super::note::Entity", from = "Column::NoteId", to = "super::note::Column::Id", on_update = "NoAction", on_delete = "Cascade" )] Note, #[sea_orm( belongs_to = "super::user::Entity", from = "Column::NotifierId", to = "super::user::Column::Id", on_update = "NoAction", on_delete = "Cascade" )] User2, #[sea_orm( belongs_to = "super::user::Entity", from = "Column::NotifieeId", to = "super::user::Column::Id", on_update = "NoAction", on_delete = "Cascade" )] User1, #[sea_orm( belongs_to = "super::user_group_invitation::Entity", from = "Column::UserGroupInvitationId", to = "super::user_group_invitation::Column::Id", on_update = "NoAction", on_delete = "Cascade" )] UserGroupInvitation, } impl Related for Entity { fn to() -> RelationDef { Relation::AccessToken.def() } } impl Related for Entity { fn to() -> RelationDef { Relation::FollowRequest.def() } } impl Related for Entity { fn to() -> RelationDef { Relation::Note.def() } } impl Related for Entity { fn to() -> RelationDef { Relation::UserGroupInvitation.def() } } impl ActiveModelBehavior for ActiveModel {}