feat: add new database entities and migration for proxy configuration
- Introduced `log_setting`, `proxy_config`, `proxy_setting`, `rewrite_rule`, `server_block`, `ssl_certificate`, and `upstream` entities with their respective fields and relationships. - Updated `mod.rs` and `prelude.rs` to include new entities. - Created migration script to set up new tables and relationships in the database. - Altered existing `agents` table to include a foreign key reference to `agent_group`.
This commit is contained in:
37
apps/nxmesh-master/src/db/entities/config_inheritance.rs
Normal file
37
apps/nxmesh-master/src/db/entities/config_inheritance.rs
Normal file
@@ -0,0 +1,37 @@
|
||||
//! `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 = "config_inheritance")]
|
||||
pub struct Model {
|
||||
#[sea_orm(primary_key, auto_increment = false)]
|
||||
pub id: Uuid,
|
||||
pub child_config_id: Uuid,
|
||||
pub parent_config_id: Uuid,
|
||||
pub priority: Option<i32>,
|
||||
pub applied_at: DateTime,
|
||||
}
|
||||
|
||||
#[derive(Copy, Clone, Debug, EnumIter, DeriveRelation)]
|
||||
pub enum Relation {
|
||||
#[sea_orm(
|
||||
belongs_to = "super::proxy_config::Entity",
|
||||
from = "Column::ChildConfigId",
|
||||
to = "super::proxy_config::Column::Id",
|
||||
on_update = "Cascade",
|
||||
on_delete = "Cascade"
|
||||
)]
|
||||
ProxyConfig2,
|
||||
#[sea_orm(
|
||||
belongs_to = "super::proxy_config::Entity",
|
||||
from = "Column::ParentConfigId",
|
||||
to = "super::proxy_config::Column::Id",
|
||||
on_update = "Cascade",
|
||||
on_delete = "Cascade"
|
||||
)]
|
||||
ProxyConfig1,
|
||||
}
|
||||
|
||||
impl ActiveModelBehavior for ActiveModel {}
|
||||
Reference in New Issue
Block a user