Initial commit squashed

This commit is contained in:
2023-05-28 15:17:13 +05:30
commit fe253b8646
76 changed files with 30659 additions and 0 deletions

View File

@@ -0,0 +1,32 @@
//! `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_person")]
pub struct Model {
#[sea_orm(primary_key)]
pub id: i32,
pub person: 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 {}