tdm_server_rust/sea_entity/
mangaauthor.rs1use sea_orm::entity::prelude::*;
4use serde::{Deserialize, Serialize};
5
6#[derive(Clone, Debug, PartialEq, DeriveEntityModel, Eq, Serialize, Deserialize)]
9#[sea_orm(table_name = "mangaauthor")]
10pub struct Model {
11 #[sea_orm(column_name = "Id", primary_key)]
13 pub id: i32,
14 #[sea_orm(column_name = "mangaId")]
16 pub manga_id: i32,
17 #[sea_orm(column_name = "authorId")]
19 pub author_id: i32,
20 pub r#type: i32,
22}
23
24#[derive(Copy, Clone, Debug, EnumIter, DeriveRelation)]
26pub enum Relation {
27 #[sea_orm(
29 belongs_to = "super::mangatb::Entity",
30 from = "Column::MangaId",
31 to = "super::mangatb::Column::Id"
32 )]
33 Mangatb,
34 #[sea_orm(
36 belongs_to = "super::authortb::Entity",
37 from = "Column::AuthorId",
38 to = "super::authortb::Column::Id"
39 )]
40 Authortb,
41}
42
43impl ActiveModelBehavior for ActiveModel {}