//! `SeaORM` Entity, @generated by sea-orm-codegen 1.1.0

use sea_orm::entity::prelude::*;

#[derive(Clone, Debug, PartialEq, DeriveEntityModel, Eq)]
#[sea_orm(table_name = "menu_sku_spec")]
pub struct Model {
    #[sea_orm(primary_key, auto_increment = false)]
    pub sku_id: i32,
    #[sea_orm(primary_key, auto_increment = false)]
    pub spec_id: i32,
}

#[derive(Copy, Clone, Debug, EnumIter, DeriveRelation)]
pub enum Relation {
    #[sea_orm(
        belongs_to = "super::menu_sku::Entity",
        from = "Column::SkuId",
        to = "super::menu_sku::Column::Id",
        on_update = "NoAction",
        on_delete = "NoAction"
    )]
    MenuSku,
    #[sea_orm(
        belongs_to = "super::menu_spec::Entity",
        from = "Column::SpecId",
        to = "super::menu_spec::Column::Id",
        on_update = "NoAction",
        on_delete = "NoAction"
    )]
    MenuSpec,
}

impl Related<super::menu_sku::Entity> for Entity {
    fn to() -> RelationDef {
        Relation::MenuSku.def()
    }
}

impl Related<super::menu_spec::Entity> for Entity {
    fn to() -> RelationDef {
        Relation::MenuSpec.def()
    }
}

impl ActiveModelBehavior for ActiveModel {}
