//! SeaORM Entity. Generated by sea-orm-codegen 0.9.3

use sea_orm::entity::prelude::*;

#[derive(Clone, Debug, PartialEq, DeriveEntityModel)]
#[sea_orm(table_name = "admin")]
pub struct Model {
    #[sea_orm(primary_key)]
    pub id: i32,
    pub name: String,
    pub public_key: String,
    #[sea_orm(column_type = "Text")]
    pub private_key: String,
    pub password: String,
    pub created_at: DateTime,
    pub updated_at: DateTime,
}

#[derive(Copy, Clone, Debug, EnumIter, DeriveRelation)]
pub enum Relation {
    #[sea_orm(has_many = "super::admin_session::Entity")]
    AdminSession,
}

impl Related<super::admin_session::Entity> for Entity {
    fn to() -> RelationDef {
        Relation::AdminSession.def()
    }
}

impl ActiveModelBehavior for ActiveModel {}
