mirror of
https://github.com/andwati/dokploy.git
synced 2026-11-19 18:48:52 +00:00
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:
@@ -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
@@ -1030,6 +1030,13 @@
|
|||||||
"when": 1771621786767,
|
"when": 1771621786767,
|
||||||
"tag": "0146_stormy_ender_wiggin",
|
"tag": "0146_stormy_ender_wiggin",
|
||||||
"breakpoints": true
|
"breakpoints": true
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"idx": 147,
|
||||||
|
"version": "7",
|
||||||
|
"when": 1771746731110,
|
||||||
|
"tag": "0147_nasty_scarecrow",
|
||||||
|
"breakpoints": true
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
@@ -226,6 +226,7 @@ export const applications = pgTable("application", {
|
|||||||
onDelete: "set null",
|
onDelete: "set null",
|
||||||
},
|
},
|
||||||
),
|
),
|
||||||
|
networkIds: text("networkIds").array().default([]),
|
||||||
});
|
});
|
||||||
|
|
||||||
export const applicationsRelations = relations(
|
export const applicationsRelations = relations(
|
||||||
@@ -366,6 +367,7 @@ const createSchema = createInsertSchema(applications, {
|
|||||||
previewRequireCollaboratorPermissions: z.boolean().optional(),
|
previewRequireCollaboratorPermissions: z.boolean().optional(),
|
||||||
watchPaths: z.array(z.string()).optional(),
|
watchPaths: z.array(z.string()).optional(),
|
||||||
previewLabels: z.array(z.string()).optional(),
|
previewLabels: z.array(z.string()).optional(),
|
||||||
|
networkIds: z.array(z.string()).optional(),
|
||||||
cleanCache: z.boolean().optional(),
|
cleanCache: z.boolean().optional(),
|
||||||
stopGracePeriodSwarm: z.bigint().nullable(),
|
stopGracePeriodSwarm: z.bigint().nullable(),
|
||||||
endpointSpecSwarm: EndpointSpecSwarmSchema.nullable(),
|
endpointSpecSwarm: EndpointSpecSwarmSchema.nullable(),
|
||||||
|
|||||||
@@ -108,6 +108,7 @@ export const compose = pgTable("compose", {
|
|||||||
serverId: text("serverId").references(() => server.serverId, {
|
serverId: text("serverId").references(() => server.serverId, {
|
||||||
onDelete: "cascade",
|
onDelete: "cascade",
|
||||||
}),
|
}),
|
||||||
|
networkIds: text("networkIds").array().default([]),
|
||||||
});
|
});
|
||||||
|
|
||||||
export const composeRelations = relations(compose, ({ one, many }) => ({
|
export const composeRelations = relations(compose, ({ one, many }) => ({
|
||||||
|
|||||||
@@ -81,6 +81,7 @@ export const mariadb = pgTable("mariadb", {
|
|||||||
serverId: text("serverId").references(() => server.serverId, {
|
serverId: text("serverId").references(() => server.serverId, {
|
||||||
onDelete: "cascade",
|
onDelete: "cascade",
|
||||||
}),
|
}),
|
||||||
|
networkIds: text("networkIds").array().default([]),
|
||||||
});
|
});
|
||||||
|
|
||||||
export const mariadbRelations = relations(mariadb, ({ one, many }) => ({
|
export const mariadbRelations = relations(mariadb, ({ one, many }) => ({
|
||||||
|
|||||||
@@ -85,6 +85,7 @@ export const mongo = pgTable("mongo", {
|
|||||||
onDelete: "cascade",
|
onDelete: "cascade",
|
||||||
}),
|
}),
|
||||||
replicaSets: boolean("replicaSets").default(false),
|
replicaSets: boolean("replicaSets").default(false),
|
||||||
|
networkIds: text("networkIds").array().default([]),
|
||||||
});
|
});
|
||||||
|
|
||||||
export const mongoRelations = relations(mongo, ({ one, many }) => ({
|
export const mongoRelations = relations(mongo, ({ one, many }) => ({
|
||||||
|
|||||||
@@ -79,6 +79,7 @@ export const mysql = pgTable("mysql", {
|
|||||||
serverId: text("serverId").references(() => server.serverId, {
|
serverId: text("serverId").references(() => server.serverId, {
|
||||||
onDelete: "cascade",
|
onDelete: "cascade",
|
||||||
}),
|
}),
|
||||||
|
networkIds: text("networkIds").array().default([]),
|
||||||
});
|
});
|
||||||
|
|
||||||
export const mysqlRelations = relations(mysql, ({ one, many }) => ({
|
export const mysqlRelations = relations(mysql, ({ one, many }) => ({
|
||||||
|
|||||||
@@ -79,6 +79,7 @@ export const postgres = pgTable("postgres", {
|
|||||||
serverId: text("serverId").references(() => server.serverId, {
|
serverId: text("serverId").references(() => server.serverId, {
|
||||||
onDelete: "cascade",
|
onDelete: "cascade",
|
||||||
}),
|
}),
|
||||||
|
networkIds: text("networkIds").array().default([]),
|
||||||
});
|
});
|
||||||
|
|
||||||
export const postgresRelations = relations(postgres, ({ one, many }) => ({
|
export const postgresRelations = relations(postgres, ({ one, many }) => ({
|
||||||
|
|||||||
@@ -75,6 +75,7 @@ export const redis = pgTable("redis", {
|
|||||||
serverId: text("serverId").references(() => server.serverId, {
|
serverId: text("serverId").references(() => server.serverId, {
|
||||||
onDelete: "cascade",
|
onDelete: "cascade",
|
||||||
}),
|
}),
|
||||||
|
networkIds: text("networkIds").array().default([]),
|
||||||
});
|
});
|
||||||
|
|
||||||
export const redisRelations = relations(redis, ({ one, many }) => ({
|
export const redisRelations = relations(redis, ({ one, many }) => ({
|
||||||
|
|||||||
@@ -99,6 +99,7 @@ export const findApplicationById = async (applicationId: string) => {
|
|||||||
project: true,
|
project: true,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|
||||||
domains: true,
|
domains: true,
|
||||||
deployments: true,
|
deployments: true,
|
||||||
mounts: true,
|
mounts: true,
|
||||||
|
|||||||
Reference in New Issue
Block a user