//! `SeaORM` Entity. Generated by sea-orm-codegen 0.11.3

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

use super::sea_orm_active_enums::{Gender, LocationFilter};

#[derive(Clone, Debug, PartialEq, DeriveEntityModel, Eq)]
#[sea_orm(table_name = "users")]
pub struct Model {
    #[sea_orm(primary_key, auto_increment = false)]
    pub id: i64,
    pub name: String,
    pub gender: Gender,
    pub gender_filter: Option<Gender>,
    pub about: String,
    pub active: bool,
    pub last_activity: DateTime,
    pub graduation_year: i16,
    pub grade_up_filter: i16,
    pub grade_down_filter: i16,
    pub subjects: i32,
    pub subjects_filter: i32,
    pub dating_purpose: i16,
    pub city: Option<i32>,
    pub location_filter: LocationFilter,
}

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

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

impl ActiveModelBehavior for ActiveModel {}
