feat: add publishMode column to port schema

- Introduced a new ENUM type "publishModeType" with values 'ingress' and 'host'.
- Added "publishMode" column to the "port" table with a default value of 'host'.
- Updated related metadata files to reflect the changes.
This commit is contained in:
Mauricio Siu
2025-07-04 23:33:21 -06:00
parent 56fcaa8ccd
commit f51c51958f
4 changed files with 7 additions and 6 deletions

View File

@@ -1,2 +1,2 @@
CREATE TYPE "public"."publishModeType" AS ENUM('ingress', 'host');--> statement-breakpoint
ALTER TABLE "port" ADD COLUMN "publishMode" "publishModeType" NOT NULL;
ALTER TABLE "port" ADD COLUMN "publishMode" "publishModeType" DEFAULT 'host' NOT NULL;

View File

@@ -1,5 +1,5 @@
{
"id": "d95fe8f9-614d-4473-82f7-f2fb716a35b1",
"id": "71f68c87-ddb4-4e8c-b9fc-1db7fbcedf56",
"prevId": "edde8c54-b715-4db6-bc3a-85d435226083",
"version": "7",
"dialect": "postgresql",
@@ -2838,7 +2838,8 @@
"type": "publishModeType",
"typeSchema": "public",
"primaryKey": false,
"notNull": true
"notNull": true,
"default": "'host'"
},
"targetPort": {
"name": "targetPort",

View File

@@ -698,8 +698,8 @@
{
"idx": 99,
"version": "7",
"when": 1751643236788,
"tag": "0099_calm_mesmero",
"when": 1751693569786,
"tag": "0099_wise_golden_guardian",
"breakpoints": true
}
]

View File

@@ -14,7 +14,7 @@ export const ports = pgTable("port", {
.primaryKey()
.$defaultFn(() => nanoid()),
publishedPort: integer("publishedPort").notNull(),
publishMode: publishModeType("publishMode").notNull(),
publishMode: publishModeType("publishMode").notNull().default("host"),
targetPort: integer("targetPort").notNull(),
protocol: protocolType("protocol").notNull(),