ApfelNetzwerk/crates/entity/src/node_group.rs
2024-10-08 16:50:22 +02:00

26 lines
659 B
Rust

//! `SeaORM` Entity, @generated by sea-orm-codegen 1.0.1
use sea_orm::entity::prelude::*;
use serde::{Deserialize, Serialize};
#[derive(Clone, Debug, PartialEq, DeriveEntityModel, Eq, Serialize, Deserialize)]
#[sea_orm(table_name = "node_group")]
pub struct Model {
#[sea_orm(primary_key, auto_increment = false)]
pub id: Uuid,
pub name: String,
}
#[derive(Copy, Clone, Debug, EnumIter, DeriveRelation)]
pub enum Relation {
#[sea_orm(has_many = "super::node::Entity")]
Node,
}
impl Related<super::node::Entity> for Entity {
fn to() -> RelationDef {
Relation::Node.def()
}
}
impl ActiveModelBehavior for ActiveModel {}