feat: add networkIds column to multiple database tables

- Introduced a new column "networkIds" of type text[] with a default value of an empty array to the application, compose, mariadb, mongo, mysql, postgres, and redis tables.
- Updated the application and compose schemas to include the new networkIds field in their respective TypeScript definitions.
- Added corresponding entries in the migration journal and created a snapshot for version 7 to reflect these changes.
This commit is contained in:
Mauricio Siu
2026-02-22 01:53:36 -06:00
parent a0566cdbd7
commit efcad7bbf5
11 changed files with 7676 additions and 0 deletions

View File

@@ -0,0 +1,7 @@
ALTER TABLE "application" ADD COLUMN "networkIds" text[] DEFAULT '{}';--> statement-breakpoint
ALTER TABLE "compose" ADD COLUMN "networkIds" text[] DEFAULT '{}';--> statement-breakpoint
ALTER TABLE "mariadb" ADD COLUMN "networkIds" text[] DEFAULT '{}';--> statement-breakpoint
ALTER TABLE "mongo" ADD COLUMN "networkIds" text[] DEFAULT '{}';--> statement-breakpoint
ALTER TABLE "mysql" ADD COLUMN "networkIds" text[] DEFAULT '{}';--> statement-breakpoint
ALTER TABLE "postgres" ADD COLUMN "networkIds" text[] DEFAULT '{}';--> statement-breakpoint
ALTER TABLE "redis" ADD COLUMN "networkIds" text[] DEFAULT '{}';

File diff suppressed because it is too large Load Diff

View File

@@ -1030,6 +1030,13 @@
"when": 1771621786767,
"tag": "0146_stormy_ender_wiggin",
"breakpoints": true
},
{
"idx": 147,
"version": "7",
"when": 1771746731110,
"tag": "0147_nasty_scarecrow",
"breakpoints": true
}
]
}

View File

@@ -226,6 +226,7 @@ export const applications = pgTable("application", {
onDelete: "set null",
},
),
networkIds: text("networkIds").array().default([]),
});
export const applicationsRelations = relations(
@@ -366,6 +367,7 @@ const createSchema = createInsertSchema(applications, {
previewRequireCollaboratorPermissions: z.boolean().optional(),
watchPaths: z.array(z.string()).optional(),
previewLabels: z.array(z.string()).optional(),
networkIds: z.array(z.string()).optional(),
cleanCache: z.boolean().optional(),
stopGracePeriodSwarm: z.bigint().nullable(),
endpointSpecSwarm: EndpointSpecSwarmSchema.nullable(),

View File

@@ -108,6 +108,7 @@ export const compose = pgTable("compose", {
serverId: text("serverId").references(() => server.serverId, {
onDelete: "cascade",
}),
networkIds: text("networkIds").array().default([]),
});
export const composeRelations = relations(compose, ({ one, many }) => ({

View File

@@ -81,6 +81,7 @@ export const mariadb = pgTable("mariadb", {
serverId: text("serverId").references(() => server.serverId, {
onDelete: "cascade",
}),
networkIds: text("networkIds").array().default([]),
});
export const mariadbRelations = relations(mariadb, ({ one, many }) => ({

View File

@@ -85,6 +85,7 @@ export const mongo = pgTable("mongo", {
onDelete: "cascade",
}),
replicaSets: boolean("replicaSets").default(false),
networkIds: text("networkIds").array().default([]),
});
export const mongoRelations = relations(mongo, ({ one, many }) => ({

View File

@@ -79,6 +79,7 @@ export const mysql = pgTable("mysql", {
serverId: text("serverId").references(() => server.serverId, {
onDelete: "cascade",
}),
networkIds: text("networkIds").array().default([]),
});
export const mysqlRelations = relations(mysql, ({ one, many }) => ({

View File

@@ -79,6 +79,7 @@ export const postgres = pgTable("postgres", {
serverId: text("serverId").references(() => server.serverId, {
onDelete: "cascade",
}),
networkIds: text("networkIds").array().default([]),
});
export const postgresRelations = relations(postgres, ({ one, many }) => ({

View File

@@ -75,6 +75,7 @@ export const redis = pgTable("redis", {
serverId: text("serverId").references(() => server.serverId, {
onDelete: "cascade",
}),
networkIds: text("networkIds").array().default([]),
});
export const redisRelations = relations(redis, ({ one, many }) => ({

View File

@@ -99,6 +99,7 @@ export const findApplicationById = async (applicationId: string) => {
project: true,
},
},
domains: true,
deployments: true,
mounts: true,