mirror of
https://github.com/clowzed/sero
synced 2024-06-28 02:50:04 +02:00
28 lines
640 B
Rust
28 lines
640 B
Rust
//! `SeaORM` Entity. Generated by sea-orm-codegen 0.12.3
|
|
|
|
use sea_orm::entity::prelude::*;
|
|
|
|
#[derive(Clone, Debug, PartialEq, DeriveEntityModel, Eq)]
|
|
#[sea_orm(table_name = "user")]
|
|
pub struct Model {
|
|
#[sea_orm(primary_key)]
|
|
pub id: i32,
|
|
#[sea_orm(unique)]
|
|
pub username: String,
|
|
pub password: String,
|
|
}
|
|
|
|
#[derive(Copy, Clone, Debug, EnumIter, DeriveRelation)]
|
|
pub enum Relation {
|
|
#[sea_orm(has_many = "super::subdomain::Entity")]
|
|
Subdomain,
|
|
}
|
|
|
|
impl Related<super::subdomain::Entity> for Entity {
|
|
fn to() -> RelationDef {
|
|
Relation::Subdomain.def()
|
|
}
|
|
}
|
|
|
|
impl ActiveModelBehavior for ActiveModel {}
|