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