kellnr_entity/
crate_category.rs1use sea_orm::entity::prelude::*;
4
5#[derive(Clone, Debug, PartialEq, DeriveEntityModel, Eq)]
6#[sea_orm(table_name = "crate_category")]
7pub struct Model {
8 #[sea_orm(primary_key)]
9 pub id: i64,
10 #[sea_orm(column_type = "Text", unique)]
11 pub category: String,
12}
13
14#[derive(Copy, Clone, Debug, EnumIter, DeriveRelation)]
15pub enum Relation {
16 #[sea_orm(has_many = "super::crate_category_to_crate::Entity")]
17 CrateCategoryToCrate,
18}
19
20impl Related<super::crate_category_to_crate::Entity> for Entity {
21 fn to() -> RelationDef {
22 Relation::CrateCategoryToCrate.def()
23 }
24}
25
26impl ActiveModelBehavior for ActiveModel {}