From 585e8aa3f702b4e5df1407472bd740a4fb4e10a3 Mon Sep 17 00:00:00 2001 From: Vantz Stockwell Date: Sun, 22 Feb 2026 01:16:08 -0500 Subject: [PATCH] feat: Add teleport_configs DB migration + TypeORM entity Co-Authored-By: Claude Opus 4.6 --- .../src/entities/teleport-config.entity.ts | 33 +++++++++++++++++++ backend/migrations/014_teleport_configs.sql | 12 +++++++ 2 files changed, 45 insertions(+) create mode 100644 backend-nest/src/entities/teleport-config.entity.ts create mode 100644 backend/migrations/014_teleport_configs.sql diff --git a/backend-nest/src/entities/teleport-config.entity.ts b/backend-nest/src/entities/teleport-config.entity.ts new file mode 100644 index 0000000..096bb7c --- /dev/null +++ b/backend-nest/src/entities/teleport-config.entity.ts @@ -0,0 +1,33 @@ +import { Entity, PrimaryGeneratedColumn, Column, ManyToOne, JoinColumn } from 'typeorm'; +import { License } from './license.entity'; + +@Entity('teleport_configs') +export class TeleportConfig { + @PrimaryGeneratedColumn('uuid') + id: string; + + @Column({ type: 'uuid' }) + license_id: string; + + @Column({ type: 'varchar', length: 100 }) + config_name: string; + + @Column({ type: 'text', nullable: true }) + description: string | null; + + @Column({ type: 'jsonb', default: () => "'{}'" }) + config_data: Record; + + @Column({ type: 'boolean', default: false }) + is_active: boolean; + + @Column({ type: 'timestamptz', default: () => 'NOW()' }) + created_at: Date; + + @Column({ type: 'timestamptz', default: () => 'NOW()' }) + updated_at: Date; + + @ManyToOne(() => License, { onDelete: 'CASCADE' }) + @JoinColumn({ name: 'license_id' }) + license: License; +} diff --git a/backend/migrations/014_teleport_configs.sql b/backend/migrations/014_teleport_configs.sql new file mode 100644 index 0000000..e038422 --- /dev/null +++ b/backend/migrations/014_teleport_configs.sql @@ -0,0 +1,12 @@ +-- Teleport configuration profiles for NTeleportation integration +CREATE TABLE teleport_configs ( + id UUID PRIMARY KEY DEFAULT gen_random_uuid(), + license_id UUID NOT NULL REFERENCES licenses(id) ON DELETE CASCADE, + config_name VARCHAR(100) NOT NULL, + description TEXT, + config_data JSONB NOT NULL DEFAULT '{}', + is_active BOOLEAN NOT NULL DEFAULT false, + created_at TIMESTAMPTZ NOT NULL DEFAULT NOW(), + updated_at TIMESTAMPTZ NOT NULL DEFAULT NOW() +); +CREATE INDEX idx_teleport_configs_license ON teleport_configs(license_id);