//! `SeaORM` Entity. Generated by sea-orm-codegen 0.10.6 use sea_orm::entity::prelude::*; #[derive(Clone, Debug, PartialEq, DeriveEntityModel, Eq)] #[sea_orm(table_name = "book")] pub struct Model { #[sea_orm(primary_key)] pub id: i32, pub open_library_key: Option, pub title: String, pub edition_count: Option, pub first_publish_year: Option, pub median_page_count: Option, pub goodread_id: Option, pub description: Option, pub cover: Option, pub location: Option, pub time_added: Option, pub rating: Option, pub comments: Option, pub user_id: i32, } #[derive(Copy, Clone, Debug, EnumIter, DeriveRelation)] pub enum Relation { #[sea_orm(has_many = "super::book_author::Entity")] BookAuthor, #[sea_orm(has_many = "super::book_isbn::Entity")] BookIsbn, #[sea_orm(has_many = "super::book_person::Entity")] BookPerson, #[sea_orm(has_many = "super::book_place::Entity")] BookPlace, #[sea_orm(has_many = "super::book_subject::Entity")] BookSubject, #[sea_orm(has_many = "super::book_time::Entity")] BookTime, #[sea_orm( belongs_to = "super::user::Entity", from = "Column::UserId", to = "super::user::Column::Id", on_update = "Cascade", on_delete = "Cascade" )] User, } impl Related for Entity { fn to() -> RelationDef { Relation::BookAuthor.def() } } impl Related for Entity { fn to() -> RelationDef { Relation::BookIsbn.def() } } impl Related for Entity { fn to() -> RelationDef { Relation::BookPerson.def() } } impl Related for Entity { fn to() -> RelationDef { Relation::BookPlace.def() } } impl Related for Entity { fn to() -> RelationDef { Relation::BookSubject.def() } } impl Related for Entity { fn to() -> RelationDef { Relation::BookTime.def() } } impl Related for Entity { fn to() -> RelationDef { Relation::User.def() } } impl ActiveModelBehavior for ActiveModel {}