sidebar and shit
This commit is contained in:
@@ -18,12 +18,21 @@ pub struct Model {
|
||||
pub image_id: Option<String>,
|
||||
pub position: i32,
|
||||
pub published: bool,
|
||||
pub parent_id: Option<i32>,
|
||||
}
|
||||
|
||||
#[derive(Copy, Clone, Debug, EnumIter, DeriveRelation)]
|
||||
pub enum Relation {
|
||||
#[sea_orm(has_many = "super::products::Entity")]
|
||||
Products,
|
||||
#[sea_orm(
|
||||
belongs_to = "Entity",
|
||||
from = "Column::ParentId",
|
||||
to = "Column::Id",
|
||||
on_update = "Cascade",
|
||||
on_delete = "SetNull"
|
||||
)]
|
||||
Parent,
|
||||
}
|
||||
|
||||
impl Related<super::products::Entity> for Entity {
|
||||
|
||||
Reference in New Issue
Block a user