From 743621eb2539485fa98e1f33ec48b394fda820c7 Mon Sep 17 00:00:00 2001 From: Owen Date: Tue, 12 May 2026 21:48:59 -0700 Subject: [PATCH] Add browserGatewayTarget table --- server/db/pg/schema/privateSchema.ts | 20 ++++++++++++++++++++ server/db/sqlite/schema/privateSchema.ts | 22 ++++++++++++++++++++++ 2 files changed, 42 insertions(+) diff --git a/server/db/pg/schema/privateSchema.ts b/server/db/pg/schema/privateSchema.ts index 229fc9ff0..3b4f459f3 100644 --- a/server/db/pg/schema/privateSchema.ts +++ b/server/db/pg/schema/privateSchema.ts @@ -580,6 +580,23 @@ export const trialNotifications = pgTable("trialNotifications", { sentAt: bigint("sentAt", { mode: "number" }).notNull() }); +export const browserGatewayTarget = pgTable("browserGatewayTarget", { + browserGatewayTargetId: serial("browserGatewayTargetId").primaryKey(), + resourceId: integer("resourceId") + .references(() => resources.resourceId, { + onDelete: "cascade" + }) + .notNull(), + siteId: integer("siteId") + .references(() => sites.siteId, { + onDelete: "cascade" + }) + .notNull(), + type: varchar("type").notNull(), // "ssh", "rdp", "vnc" + destination: varchar("destination").notNull(), + destinationPort: integer("destinationPort").notNull() +}); + export type Approval = InferSelectModel; export type Limit = InferSelectModel; export type Account = InferSelectModel; @@ -627,3 +644,6 @@ export type AlertEmailRecipients = InferSelectModel< >; export type AlertWebhookActions = InferSelectModel; export type TrialNotification = InferSelectModel; +export type BrowserGatewayTarget = InferSelectModel< + typeof browserGatewayTarget +>; diff --git a/server/db/sqlite/schema/privateSchema.ts b/server/db/sqlite/schema/privateSchema.ts index ae7360780..1fdace69b 100644 --- a/server/db/sqlite/schema/privateSchema.ts +++ b/server/db/sqlite/schema/privateSchema.ts @@ -588,6 +588,25 @@ export const trialNotifications = sqliteTable("trialNotifications", { sentAt: integer("sentAt").notNull() }); +export const browserGatewayTarget = sqliteTable("browserGatewayTarget", { + browserGatewayTargetId: integer("browserGatewayTargetId").primaryKey({ + autoIncrement: true + }), + resourceId: integer("resourceId") + .references(() => resources.resourceId, { + onDelete: "cascade" + }) + .notNull(), + siteId: integer("siteId") + .references(() => sites.siteId, { + onDelete: "cascade" + }) + .notNull(), + type: text("type").notNull(), // "ssh", "rdp", "vnc" + destination: text("destination").notNull(), + destinationPort: integer("destinationPort").notNull() +}); + export type Approval = InferSelectModel; export type Limit = InferSelectModel; export type Account = InferSelectModel; @@ -627,3 +646,6 @@ export type AlertEmailAction = InferSelectModel; export type AlertEmailRecipient = InferSelectModel; export type AlertWebhookAction = InferSelectModel; export type TrialNotification = InferSelectModel; +export type BrowserGatewayTarget = InferSelectModel< + typeof browserGatewayTarget +>;