34 lines
822 B
Rust
34 lines
822 B
Rust
//! `SeaORM` Entity. Generated by sea-orm-codegen 0.10.7
|
|
|
|
use sea_orm::entity::prelude::*;
|
|
|
|
#[derive(Clone, Debug, PartialEq, DeriveEntityModel, Eq)]
|
|
#[sea_orm(table_name = "post_block")]
|
|
pub struct Model {
|
|
#[sea_orm(primary_key, auto_increment = false)]
|
|
pub id: String,
|
|
pub owner: String,
|
|
pub order: i32,
|
|
pub r#type: String,
|
|
pub content: String,
|
|
}
|
|
|
|
#[derive(Copy, Clone, Debug, EnumIter, DeriveRelation)]
|
|
pub enum Relation {
|
|
#[sea_orm(
|
|
belongs_to = "super::post::Entity",
|
|
from = "Column::Owner",
|
|
to = "super::post::Column::Id",
|
|
on_update = "NoAction",
|
|
on_delete = "NoAction"
|
|
)]
|
|
Post,
|
|
}
|
|
|
|
impl Related<super::post::Entity> for Entity {
|
|
fn to() -> RelationDef {
|
|
Relation::Post.def()
|
|
}
|
|
}
|
|
|
|
impl ActiveModelBehavior for ActiveModel {}
|