tdm_server_rust/sea_entity/
mangamagazine.rs1use sea_orm::entity::prelude::*;
4use serde::{Deserialize, Serialize};
5
6#[derive(Clone, Debug, PartialEq, DeriveEntityModel, Eq, Serialize, Deserialize)]
9#[sea_orm(table_name = "mangamagazine")]
10pub struct Model {
11 #[sea_orm(primary_key)]
13 pub id: i32,
14 #[sea_orm(column_name = "mangaId")]
16 pub manga_id: Option<i32>,
17 #[sea_orm(column_name = "magazineId")]
19 pub magazine_id: Option<i32>,
20}
21
22#[derive(Copy, Clone, Debug, EnumIter, DeriveRelation)]
24pub enum Relation {
25 #[sea_orm(
27 belongs_to = "super::mangatb::Entity",
28 from = "Column::MangaId",
29 to = "super::mangatb::Column::Id"
30 )]
31 Mangatb,
32 #[sea_orm(
34 belongs_to = "super::magazine::Entity",
35 from = "Column::MagazineId",
36 to = "super::magazine::Column::Id"
37 )]
38 Magazine,
39}
40
41impl ActiveModelBehavior for ActiveModel {}