From d7cbb2a2ce360f075ca4ec28ab07692424941eb0 Mon Sep 17 00:00:00 2001 From: GW_MC <72297530+GWMCwing@users.noreply.github.com> Date: Sat, 21 Mar 2026 03:17:43 +0000 Subject: [PATCH] feat: Remove unused SeaORM entity files for certificates, organizations, setup tokens, upstreams, users, virtual hosts, and workspaces --- .../src/db/entities/certificates.rs | 45 ------------ .../src/db/entities/organizations.rs | 39 ----------- .../src/db/entities/setup_tokens.rs | 21 ------ .../src/db/entities/upstreams.rs | 40 ----------- apps/nxmesh-master/src/db/entities/users.rs | 39 ----------- .../src/db/entities/virtual_hosts.rs | 44 ------------ .../src/db/entities/workspaces.rs | 70 ------------------- 7 files changed, 298 deletions(-) delete mode 100644 apps/nxmesh-master/src/db/entities/certificates.rs delete mode 100644 apps/nxmesh-master/src/db/entities/organizations.rs delete mode 100644 apps/nxmesh-master/src/db/entities/setup_tokens.rs delete mode 100644 apps/nxmesh-master/src/db/entities/upstreams.rs delete mode 100644 apps/nxmesh-master/src/db/entities/users.rs delete mode 100644 apps/nxmesh-master/src/db/entities/virtual_hosts.rs delete mode 100644 apps/nxmesh-master/src/db/entities/workspaces.rs diff --git a/apps/nxmesh-master/src/db/entities/certificates.rs b/apps/nxmesh-master/src/db/entities/certificates.rs deleted file mode 100644 index c9acd4e..0000000 --- a/apps/nxmesh-master/src/db/entities/certificates.rs +++ /dev/null @@ -1,45 +0,0 @@ -//! `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 = "certificates")] -pub struct Model { - #[sea_orm(primary_key, auto_increment = false)] - pub id: Uuid, - pub workspace_id: Uuid, - pub domain: String, - pub is_wildcard: bool, - pub provider: Option, - pub status: Option, - pub issued_at: Option, - pub expires_at: Option, - pub auto_renew: bool, - #[sea_orm(column_type = "Text", nullable)] - pub certificate_pem: Option, - #[sea_orm(column_type = "Text", nullable)] - pub private_key_pem: Option, - pub created_at: DateTimeWithTimeZone, - pub updated_at: DateTimeWithTimeZone, -} - -#[derive(Copy, Clone, Debug, EnumIter, DeriveRelation)] -pub enum Relation { - #[sea_orm( - belongs_to = "super::workspaces::Entity", - from = "Column::WorkspaceId", - to = "super::workspaces::Column::Id", - on_update = "NoAction", - on_delete = "Cascade" - )] - Workspaces, -} - -impl Related for Entity { - fn to() -> RelationDef { - Relation::Workspaces.def() - } -} - -impl ActiveModelBehavior for ActiveModel {} diff --git a/apps/nxmesh-master/src/db/entities/organizations.rs b/apps/nxmesh-master/src/db/entities/organizations.rs deleted file mode 100644 index a73a39e..0000000 --- a/apps/nxmesh-master/src/db/entities/organizations.rs +++ /dev/null @@ -1,39 +0,0 @@ -//! `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 = "organizations")] -pub struct Model { - #[sea_orm(primary_key, auto_increment = false)] - pub id: Uuid, - pub name: String, - #[sea_orm(unique)] - pub slug: String, - pub created_at: DateTimeWithTimeZone, - pub updated_at: DateTimeWithTimeZone, - pub settings: Option, -} - -#[derive(Copy, Clone, Debug, EnumIter, DeriveRelation)] -pub enum Relation { - #[sea_orm(has_many = "super::users::Entity")] - Users, - #[sea_orm(has_many = "super::workspaces::Entity")] - Workspaces, -} - -impl Related for Entity { - fn to() -> RelationDef { - Relation::Users.def() - } -} - -impl Related for Entity { - fn to() -> RelationDef { - Relation::Workspaces.def() - } -} - -impl ActiveModelBehavior for ActiveModel {} diff --git a/apps/nxmesh-master/src/db/entities/setup_tokens.rs b/apps/nxmesh-master/src/db/entities/setup_tokens.rs deleted file mode 100644 index aa96351..0000000 --- a/apps/nxmesh-master/src/db/entities/setup_tokens.rs +++ /dev/null @@ -1,21 +0,0 @@ -//! `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 = "setup_tokens")] -pub struct Model { - #[sea_orm(primary_key, auto_increment = false)] - pub id: Uuid, - #[sea_orm(unique)] - pub token_hash: String, - pub expires_at: DateTimeWithTimeZone, - pub used_at: Option, - pub created_at: DateTimeWithTimeZone, -} - -#[derive(Copy, Clone, Debug, EnumIter, DeriveRelation)] -pub enum Relation {} - -impl ActiveModelBehavior for ActiveModel {} diff --git a/apps/nxmesh-master/src/db/entities/upstreams.rs b/apps/nxmesh-master/src/db/entities/upstreams.rs deleted file mode 100644 index a27a1d7..0000000 --- a/apps/nxmesh-master/src/db/entities/upstreams.rs +++ /dev/null @@ -1,40 +0,0 @@ -//! `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 = "upstreams")] -pub struct Model { - #[sea_orm(primary_key, auto_increment = false)] - pub id: Uuid, - pub workspace_id: Uuid, - pub name: String, - pub algorithm: String, - pub servers: Option, - pub health_check: Option, - pub keepalive_connections: Option, - pub keepalive_timeout: Option, - pub created_at: DateTimeWithTimeZone, - pub updated_at: DateTimeWithTimeZone, -} - -#[derive(Copy, Clone, Debug, EnumIter, DeriveRelation)] -pub enum Relation { - #[sea_orm( - belongs_to = "super::workspaces::Entity", - from = "Column::WorkspaceId", - to = "super::workspaces::Column::Id", - on_update = "NoAction", - on_delete = "Cascade" - )] - Workspaces, -} - -impl Related for Entity { - fn to() -> RelationDef { - Relation::Workspaces.def() - } -} - -impl ActiveModelBehavior for ActiveModel {} diff --git a/apps/nxmesh-master/src/db/entities/users.rs b/apps/nxmesh-master/src/db/entities/users.rs deleted file mode 100644 index 33b8482..0000000 --- a/apps/nxmesh-master/src/db/entities/users.rs +++ /dev/null @@ -1,39 +0,0 @@ -//! `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 = "users")] -pub struct Model { - #[sea_orm(primary_key, auto_increment = false)] - pub id: Uuid, - #[sea_orm(unique)] - pub email: String, - pub password_hash: String, - pub name: Option, - pub role: String, - pub organization_id: Option, - pub created_at: DateTimeWithTimeZone, - pub updated_at: DateTimeWithTimeZone, -} - -#[derive(Copy, Clone, Debug, EnumIter, DeriveRelation)] -pub enum Relation { - #[sea_orm( - belongs_to = "super::organizations::Entity", - from = "Column::OrganizationId", - to = "super::organizations::Column::Id", - on_update = "NoAction", - on_delete = "SetNull" - )] - Organizations, -} - -impl Related for Entity { - fn to() -> RelationDef { - Relation::Organizations.def() - } -} - -impl ActiveModelBehavior for ActiveModel {} diff --git a/apps/nxmesh-master/src/db/entities/virtual_hosts.rs b/apps/nxmesh-master/src/db/entities/virtual_hosts.rs deleted file mode 100644 index 631a917..0000000 --- a/apps/nxmesh-master/src/db/entities/virtual_hosts.rs +++ /dev/null @@ -1,44 +0,0 @@ -//! `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 = "virtual_hosts")] -pub struct Model { - #[sea_orm(primary_key, auto_increment = false)] - pub id: Uuid, - pub workspace_id: Uuid, - pub name: String, - pub server_name: String, - pub listen_port: i32, - pub ssl_enabled: bool, - pub ssl_certificate_id: Option, - pub locations: Option, - pub http2_enabled: bool, - pub http3_enabled: bool, - pub gzip_enabled: bool, - pub target_agents: Option, - pub created_at: DateTimeWithTimeZone, - pub updated_at: DateTimeWithTimeZone, -} - -#[derive(Copy, Clone, Debug, EnumIter, DeriveRelation)] -pub enum Relation { - #[sea_orm( - belongs_to = "super::workspaces::Entity", - from = "Column::WorkspaceId", - to = "super::workspaces::Column::Id", - on_update = "NoAction", - on_delete = "Cascade" - )] - Workspaces, -} - -impl Related for Entity { - fn to() -> RelationDef { - Relation::Workspaces.def() - } -} - -impl ActiveModelBehavior for ActiveModel {} diff --git a/apps/nxmesh-master/src/db/entities/workspaces.rs b/apps/nxmesh-master/src/db/entities/workspaces.rs deleted file mode 100644 index 0cd5728..0000000 --- a/apps/nxmesh-master/src/db/entities/workspaces.rs +++ /dev/null @@ -1,70 +0,0 @@ -//! `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 = "workspaces")] -pub struct Model { - #[sea_orm(primary_key, auto_increment = false)] - pub id: Uuid, - #[sea_orm(unique_key = "idx_workspaces_org_slug")] - pub organization_id: Uuid, - pub name: String, - #[sea_orm(unique_key = "idx_workspaces_org_slug")] - pub slug: String, - pub created_at: DateTimeWithTimeZone, - pub updated_at: DateTimeWithTimeZone, -} - -#[derive(Copy, Clone, Debug, EnumIter, DeriveRelation)] -pub enum Relation { - #[sea_orm(has_many = "super::agents::Entity")] - Agents, - #[sea_orm(has_many = "super::certificates::Entity")] - Certificates, - #[sea_orm( - belongs_to = "super::organizations::Entity", - from = "Column::OrganizationId", - to = "super::organizations::Column::Id", - on_update = "NoAction", - on_delete = "Cascade" - )] - Organizations, - #[sea_orm(has_many = "super::upstreams::Entity")] - Upstreams, - #[sea_orm(has_many = "super::virtual_hosts::Entity")] - VirtualHosts, -} - -impl Related for Entity { - fn to() -> RelationDef { - Relation::Agents.def() - } -} - -impl Related for Entity { - fn to() -> RelationDef { - Relation::Certificates.def() - } -} - -impl Related for Entity { - fn to() -> RelationDef { - Relation::Organizations.def() - } -} - -impl Related for Entity { - fn to() -> RelationDef { - Relation::Upstreams.def() - } -} - -impl Related for Entity { - fn to() -> RelationDef { - Relation::VirtualHosts.def() - } -} - -impl ActiveModelBehavior for ActiveModel {}