aah/entity/src/service.rs
2023-08-07 18:36:33 -05:00

40 lines
888 B
Rust

//! `SeaORM` Entity. Generated by sea-orm-codegen 0.12.2
use sea_orm::entity::prelude::*;
use serde::{Deserialize, Serialize};
#[derive(
Clone, Debug, PartialEq, DeriveEntityModel, Eq, Serialize, Deserialize,
)]
#[sea_orm(table_name = "service")]
pub struct Model {
#[sea_orm(primary_key)]
pub id: i32,
pub name: String,
pub config: String,
pub status: String,
pub in_progress_since: Option<String>,
}
#[derive(Copy, Clone, Debug, EnumIter, DeriveRelation)]
pub enum Relation {
#[sea_orm(has_many = "super::process::Entity")]
Process,
#[sea_orm(has_many = "super::secrets::Entity")]
Secrets,
}
impl Related<super::process::Entity> for Entity {
fn to() -> RelationDef {
Relation::Process.def()
}
}
impl Related<super::secrets::Entity> for Entity {
fn to() -> RelationDef {
Relation::Secrets.def()
}
}
impl ActiveModelBehavior for ActiveModel {}