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

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

#[derive(Clone, Debug, PartialEq, DeriveEntityModel, Eq)]
#[sea_orm(table_name = "datings")]
pub struct Model {
    #[sea_orm(primary_key)]
    pub id: i32,
    pub initiator_id: i64,
    pub partner_id: i64,
    pub initiator_msg_id: Option<i32>,
    pub time: DateTime,
    pub initiator_reaction: Option<bool>,
    pub partner_reaction: Option<bool>,
}

#[derive(Copy, Clone, Debug, EnumIter, DeriveRelation)]
pub enum Relation {
    #[sea_orm(
        belongs_to = "super::users::Entity",
        from = "Column::InitiatorId",
        to = "super::users::Column::Id",
        on_update = "NoAction",
        on_delete = "NoAction"
    )]
    Users2,
    #[sea_orm(
        belongs_to = "super::users::Entity",
        from = "Column::PartnerId",
        to = "super::users::Column::Id",
        on_update = "NoAction",
        on_delete = "NoAction"
    )]
    Users1,
}

impl ActiveModelBehavior for ActiveModel {}
