v0.07
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
//! SeaORM Entity. Generated by sea-orm-codegen 0.9.2
|
||||
//! SeaORM Entity. Generated by sea-orm-codegen 0.9.3
|
||||
|
||||
use sea_orm::entity::prelude::*;
|
||||
|
||||
@@ -33,6 +33,8 @@ pub enum Relation {
|
||||
BookSubject,
|
||||
#[sea_orm(has_many = "super::book_time::Entity")]
|
||||
BookTime,
|
||||
#[sea_orm(has_many = "super::book_isbn::Entity")]
|
||||
BookIsbn,
|
||||
}
|
||||
|
||||
impl Related<super::book_author::Entity> for Entity {
|
||||
@@ -65,4 +67,10 @@ impl Related<super::book_time::Entity> for Entity {
|
||||
}
|
||||
}
|
||||
|
||||
impl Related<super::book_isbn::Entity> for Entity {
|
||||
fn to() -> RelationDef {
|
||||
Relation::BookIsbn.def()
|
||||
}
|
||||
}
|
||||
|
||||
impl ActiveModelBehavior for ActiveModel {}
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
//! SeaORM Entity. Generated by sea-orm-codegen 0.9.2
|
||||
//! SeaORM Entity. Generated by sea-orm-codegen 0.9.3
|
||||
|
||||
use sea_orm::entity::prelude::*;
|
||||
|
||||
|
||||
32
backend/entity/src/entities/book_isbn.rs
Normal file
32
backend/entity/src/entities/book_isbn.rs
Normal file
@@ -0,0 +1,32 @@
|
||||
//! SeaORM Entity. Generated by sea-orm-codegen 0.9.3
|
||||
|
||||
use sea_orm::entity::prelude::*;
|
||||
|
||||
#[derive(Clone, Debug, PartialEq, DeriveEntityModel)]
|
||||
#[sea_orm(table_name = "book_isbn")]
|
||||
pub struct Model {
|
||||
#[sea_orm(primary_key)]
|
||||
pub id: i32,
|
||||
pub isbn: String,
|
||||
pub book_id: i32,
|
||||
}
|
||||
|
||||
#[derive(Copy, Clone, Debug, EnumIter, DeriveRelation)]
|
||||
pub enum Relation {
|
||||
#[sea_orm(
|
||||
belongs_to = "super::book::Entity",
|
||||
from = "Column::BookId",
|
||||
to = "super::book::Column::Id",
|
||||
on_update = "Cascade",
|
||||
on_delete = "Cascade"
|
||||
)]
|
||||
Book,
|
||||
}
|
||||
|
||||
impl Related<super::book::Entity> for Entity {
|
||||
fn to() -> RelationDef {
|
||||
Relation::Book.def()
|
||||
}
|
||||
}
|
||||
|
||||
impl ActiveModelBehavior for ActiveModel {}
|
||||
@@ -1,4 +1,4 @@
|
||||
//! SeaORM Entity. Generated by sea-orm-codegen 0.9.2
|
||||
//! SeaORM Entity. Generated by sea-orm-codegen 0.9.3
|
||||
|
||||
use sea_orm::entity::prelude::*;
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
//! SeaORM Entity. Generated by sea-orm-codegen 0.9.2
|
||||
//! SeaORM Entity. Generated by sea-orm-codegen 0.9.3
|
||||
|
||||
use sea_orm::entity::prelude::*;
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
//! SeaORM Entity. Generated by sea-orm-codegen 0.9.2
|
||||
//! SeaORM Entity. Generated by sea-orm-codegen 0.9.3
|
||||
|
||||
use sea_orm::entity::prelude::*;
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
//! SeaORM Entity. Generated by sea-orm-codegen 0.9.2
|
||||
//! SeaORM Entity. Generated by sea-orm-codegen 0.9.3
|
||||
|
||||
use sea_orm::entity::prelude::*;
|
||||
|
||||
|
||||
@@ -1,9 +1,10 @@
|
||||
//! SeaORM Entity. Generated by sea-orm-codegen 0.9.2
|
||||
//! SeaORM Entity. Generated by sea-orm-codegen 0.9.3
|
||||
|
||||
pub mod prelude;
|
||||
|
||||
pub mod book;
|
||||
pub mod book_author;
|
||||
pub mod book_isbn;
|
||||
pub mod book_person;
|
||||
pub mod book_place;
|
||||
pub mod book_subject;
|
||||
|
||||
@@ -1,7 +1,8 @@
|
||||
//! SeaORM Entity. Generated by sea-orm-codegen 0.9.2
|
||||
//! SeaORM Entity. Generated by sea-orm-codegen 0.9.3
|
||||
|
||||
pub use super::book::Entity as Book;
|
||||
pub use super::book_author::Entity as BookAuthor;
|
||||
pub use super::book_isbn::Entity as BookIsbn;
|
||||
pub use super::book_person::Entity as BookPerson;
|
||||
pub use super::book_place::Entity as BookPlace;
|
||||
pub use super::book_subject::Entity as BookSubject;
|
||||
|
||||
@@ -1,3 +1,3 @@
|
||||
mod entities;
|
||||
pub use entities::*;
|
||||
pub mod entities;
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user