//! `SeaORM` Entity, @generated by sea-orm-codegen 2.0 use sea_orm::entity::prelude::*; use serde::{Deserialize, Serialize}; #[derive(Clone, Debug, PartialEq, Eq, DeriveEntityModel, Serialize, Deserialize)] #[sea_orm(table_name = "location_block")] pub struct Model { #[sea_orm(primary_key, auto_increment = false)] pub id: Uuid, pub server_id: Uuid, pub path_pattern: String, pub proxy_pass_upstream_id: Option, #[sea_orm(column_type = "JsonBinary", nullable)] pub metadata: Option, pub override_of_id: Option, } #[derive(Copy, Clone, Debug, EnumIter, DeriveRelation)] pub enum Relation { #[sea_orm(has_many = "super::access_rule::Entity")] AccessRule, #[sea_orm(has_many = "super::limit_rule::Entity")] LimitRule, #[sea_orm( belongs_to = "Entity", from = "Column::OverrideOfId", to = "Column::Id", on_update = "Cascade", on_delete = "SetNull" )] SelfRef, #[sea_orm(has_many = "super::proxy_setting::Entity")] ProxySetting, #[sea_orm(has_many = "super::rewrite_rule::Entity")] RewriteRule, #[sea_orm( belongs_to = "super::server_block::Entity", from = "Column::ServerId", to = "super::server_block::Column::Id", on_update = "Cascade", on_delete = "Cascade" )] ServerBlock, #[sea_orm( belongs_to = "super::upstream::Entity", from = "Column::ProxyPassUpstreamId", to = "super::upstream::Column::Id", on_update = "Cascade", on_delete = "SetNull" )] Upstream, } impl Related for Entity { fn to() -> RelationDef { Relation::AccessRule.def() } } impl Related for Entity { fn to() -> RelationDef { Relation::LimitRule.def() } } impl Related for Entity { fn to() -> RelationDef { Relation::ProxySetting.def() } } impl Related for Entity { fn to() -> RelationDef { Relation::RewriteRule.def() } } impl Related for Entity { fn to() -> RelationDef { Relation::ServerBlock.def() } } impl Related for Entity { fn to() -> RelationDef { Relation::Upstream.def() } } impl ActiveModelBehavior for ActiveModel {}