//! `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_spec")]
pub struct Model {
    #[sea_orm(primary_key)]
    pub id: i32,
    pub goods_id: i32,
    #[sea_orm(column_type = "Text")]
    pub name: String,
    #[sea_orm(column_type = "Text")]
    pub value: String,
    #[sea_orm(column_type = "Text", nullable)]
    pub status: Option<String>,
}

#[derive(Copy, Clone, Debug, EnumIter, DeriveRelation)]
pub enum Relation {
    #[sea_orm(has_many = "super::menu_sku_spec::Entity")]
    MenuSkuSpec,
}

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

impl Related<super::menu_sku::Entity> for Entity {
    fn to() -> RelationDef {
        super::menu_sku_spec::Relation::MenuSku.def()
    }
    fn via() -> Option<RelationDef> {
        Some(super::menu_sku_spec::Relation::MenuSpec.def().rev())
    }
}

impl ActiveModelBehavior for ActiveModel {}
