use sea_orm::prelude::*; #[derive(Clone, Debug, PartialEq, DeriveEntityModel)] #[sea_orm(table_name = "namespaces")] pub struct Model { #[sea_orm(primary_key)] pub id: i64, pub name: String, } #[derive(Copy, Clone, Debug, EnumIter, DeriveRelation)] pub enum Relation { #[sea_orm(has_many = "super::tag::Entity")] Tag, } impl Related for Entity { fn to() -> RelationDef { Relation::Tag.def() } } impl ActiveModelBehavior for ActiveModel {}