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

use sea_orm::entity::prelude::*;
use serde::{Deserialize, Serialize};
use utoipa::ToSchema;

#[derive(Clone, Debug, PartialEq, DeriveEntityModel, Eq, Serialize, Deserialize, ToSchema)]
#[sea_orm(table_name = "origin")]
pub struct Model {
    #[sea_orm(primary_key)]
    pub id: i64,
    pub subdomain_id: i64,
    pub value: String,
}

#[derive(Copy, Clone, Debug, EnumIter, DeriveRelation)]
pub enum Relation {
    #[sea_orm(
        belongs_to = "super::subdomain::Entity",
        from = "Column::SubdomainId",
        to = "super::subdomain::Column::Id",
        on_update = "NoAction",
        on_delete = "Cascade"
    )]
    Subdomain,
}

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

impl ActiveModelBehavior for ActiveModel {}
