driptorch-controller/src/entities/proxy.rs

33 lines
793 B
Rust

//! SeaORM Entity. Generated by sea-orm-codegen 0.9.2
use sea_orm::entity::prelude::*;
#[derive(Clone, Debug, PartialEq, DeriveEntityModel)]
#[sea_orm(table_name = "proxy")]
pub struct Model {
#[sea_orm(primary_key, auto_increment = false)]
pub id: String,
pub record: String,
pub port: i32,
pub active: bool,
}
#[derive(Copy, Clone, Debug, EnumIter, DeriveRelation)]
pub enum Relation {
#[sea_orm(
belongs_to = "super::record::Entity",
from = "Column::Record",
to = "super::record::Column::Id",
on_update = "NoAction",
on_delete = "Cascade"
)]
Record,
}
impl Related<super::record::Entity> for Entity {
fn to() -> RelationDef {
Relation::Record.def()
}
}
impl ActiveModelBehavior for ActiveModel {}