Skip to main content

kellnr_entity/
group.rs

1//! `SeaORM` Entity, @generated by sea-orm-codegen 1.1.17
2
3use sea_orm::entity::prelude::*;
4
5#[derive(Clone, Debug, PartialEq, DeriveEntityModel, Eq)]
6#[sea_orm(table_name = "group")]
7pub struct Model {
8    #[sea_orm(primary_key)]
9    pub id: i64,
10    #[sea_orm(column_type = "Text", unique)]
11    pub name: String,
12}
13
14#[derive(Copy, Clone, Debug, EnumIter, DeriveRelation)]
15pub enum Relation {
16    #[sea_orm(has_many = "super::crate_group::Entity")]
17    CrateGroup,
18    #[sea_orm(has_many = "super::group_user::Entity")]
19    GroupUser,
20}
21
22impl Related<super::crate_group::Entity> for Entity {
23    fn to() -> RelationDef {
24        Relation::CrateGroup.def()
25    }
26}
27
28impl Related<super::group_user::Entity> for Entity {
29    fn to() -> RelationDef {
30        Relation::GroupUser.def()
31    }
32}
33
34impl ActiveModelBehavior for ActiveModel {}