diff --git a/packages/server/src/db/schema/mariadb.ts b/packages/server/src/db/schema/mariadb.ts index 416c66e1c..5dc32f24b 100644 --- a/packages/server/src/db/schema/mariadb.ts +++ b/packages/server/src/db/schema/mariadb.ts @@ -1,5 +1,5 @@ import { relations } from "drizzle-orm"; -import { integer, json, pgTable, text } from "drizzle-orm/pg-core"; +import { bigint, integer, json, pgTable, text } from "drizzle-orm/pg-core"; import { createInsertSchema } from "drizzle-zod"; import { nanoid } from "nanoid"; import { z } from "zod"; @@ -62,6 +62,7 @@ export const mariadb = pgTable("mariadb", { modeSwarm: json("modeSwarm").$type(), labelsSwarm: json("labelsSwarm").$type(), networkSwarm: json("networkSwarm").$type(), + stopGracePeriodSwarm: bigint("stopGracePeriodSwarm", { mode: "bigint" }), replicas: integer("replicas").default(1).notNull(), createdAt: text("createdAt") .notNull() @@ -128,6 +129,7 @@ const createSchema = createInsertSchema(mariadb, { modeSwarm: ServiceModeSwarmSchema.nullable(), labelsSwarm: LabelsSwarmSchema.nullable(), networkSwarm: NetworkSwarmSchema.nullable(), + stopGracePeriodSwarm: z.bigint().nullable(), }); export const apiCreateMariaDB = createSchema diff --git a/packages/server/src/db/schema/mongo.ts b/packages/server/src/db/schema/mongo.ts index eb4661066..1d5eb0214 100644 --- a/packages/server/src/db/schema/mongo.ts +++ b/packages/server/src/db/schema/mongo.ts @@ -1,5 +1,5 @@ import { relations } from "drizzle-orm"; -import { boolean, integer, json, pgTable, text } from "drizzle-orm/pg-core"; +import { bigint, boolean, integer, json, pgTable, text } from "drizzle-orm/pg-core"; import { createInsertSchema } from "drizzle-zod"; import { nanoid } from "nanoid"; import { z } from "zod"; @@ -58,6 +58,7 @@ export const mongo = pgTable("mongo", { modeSwarm: json("modeSwarm").$type(), labelsSwarm: json("labelsSwarm").$type(), networkSwarm: json("networkSwarm").$type(), + stopGracePeriodSwarm: bigint("stopGracePeriodSwarm", { mode: "bigint" }), replicas: integer("replicas").default(1).notNull(), createdAt: text("createdAt") .notNull() @@ -118,6 +119,7 @@ const createSchema = createInsertSchema(mongo, { modeSwarm: ServiceModeSwarmSchema.nullable(), labelsSwarm: LabelsSwarmSchema.nullable(), networkSwarm: NetworkSwarmSchema.nullable(), + stopGracePeriodSwarm: z.bigint().nullable(), }); export const apiCreateMongo = createSchema diff --git a/packages/server/src/db/schema/mysql.ts b/packages/server/src/db/schema/mysql.ts index 8f87bff1e..c90048980 100644 --- a/packages/server/src/db/schema/mysql.ts +++ b/packages/server/src/db/schema/mysql.ts @@ -1,5 +1,5 @@ import { relations } from "drizzle-orm"; -import { integer, json, pgTable, text } from "drizzle-orm/pg-core"; +import { bigint, integer, json, pgTable, text } from "drizzle-orm/pg-core"; import { createInsertSchema } from "drizzle-zod"; import { nanoid } from "nanoid"; import { z } from "zod"; @@ -60,6 +60,7 @@ export const mysql = pgTable("mysql", { modeSwarm: json("modeSwarm").$type(), labelsSwarm: json("labelsSwarm").$type(), networkSwarm: json("networkSwarm").$type(), + stopGracePeriodSwarm: bigint("stopGracePeriodSwarm", { mode: "bigint" }), replicas: integer("replicas").default(1).notNull(), createdAt: text("createdAt") .notNull() @@ -125,6 +126,7 @@ const createSchema = createInsertSchema(mysql, { modeSwarm: ServiceModeSwarmSchema.nullable(), labelsSwarm: LabelsSwarmSchema.nullable(), networkSwarm: NetworkSwarmSchema.nullable(), + stopGracePeriodSwarm: z.bigint().nullable(), }); export const apiCreateMySql = createSchema diff --git a/packages/server/src/db/schema/postgres.ts b/packages/server/src/db/schema/postgres.ts index 961371b5c..375f7a9c0 100644 --- a/packages/server/src/db/schema/postgres.ts +++ b/packages/server/src/db/schema/postgres.ts @@ -1,5 +1,5 @@ import { relations } from "drizzle-orm"; -import { integer, json, pgTable, text } from "drizzle-orm/pg-core"; +import { bigint, integer, json, pgTable, text } from "drizzle-orm/pg-core"; import { createInsertSchema } from "drizzle-zod"; import { nanoid } from "nanoid"; import { z } from "zod"; @@ -60,6 +60,7 @@ export const postgres = pgTable("postgres", { modeSwarm: json("modeSwarm").$type(), labelsSwarm: json("labelsSwarm").$type(), networkSwarm: json("networkSwarm").$type(), + stopGracePeriodSwarm: bigint("stopGracePeriodSwarm", { mode: "bigint" }), replicas: integer("replicas").default(1).notNull(), createdAt: text("createdAt") .notNull() @@ -118,6 +119,7 @@ const createSchema = createInsertSchema(postgres, { modeSwarm: ServiceModeSwarmSchema.nullable(), labelsSwarm: LabelsSwarmSchema.nullable(), networkSwarm: NetworkSwarmSchema.nullable(), + stopGracePeriodSwarm: z.bigint().nullable(), }); export const apiCreatePostgres = createSchema diff --git a/packages/server/src/db/schema/redis.ts b/packages/server/src/db/schema/redis.ts index 29e40282d..0cb6dd484 100644 --- a/packages/server/src/db/schema/redis.ts +++ b/packages/server/src/db/schema/redis.ts @@ -1,5 +1,5 @@ import { relations } from "drizzle-orm"; -import { integer, json, pgTable, text } from "drizzle-orm/pg-core"; +import { bigint, integer, json, pgTable, text } from "drizzle-orm/pg-core"; import { createInsertSchema } from "drizzle-zod"; import { nanoid } from "nanoid"; import { z } from "zod"; @@ -60,6 +60,7 @@ export const redis = pgTable("redis", { modeSwarm: json("modeSwarm").$type(), labelsSwarm: json("labelsSwarm").$type(), networkSwarm: json("networkSwarm").$type(), + stopGracePeriodSwarm: bigint("stopGracePeriodSwarm", { mode: "bigint" }), replicas: integer("replicas").default(1).notNull(), environmentId: text("environmentId") @@ -108,6 +109,7 @@ const createSchema = createInsertSchema(redis, { modeSwarm: ServiceModeSwarmSchema.nullable(), labelsSwarm: LabelsSwarmSchema.nullable(), networkSwarm: NetworkSwarmSchema.nullable(), + stopGracePeriodSwarm: z.bigint().nullable(), }); export const apiCreateRedis = createSchema diff --git a/packages/server/src/utils/databases/mariadb.ts b/packages/server/src/utils/databases/mariadb.ts index 1671de454..196a394bc 100644 --- a/packages/server/src/utils/databases/mariadb.ts +++ b/packages/server/src/utils/databases/mariadb.ts @@ -45,6 +45,7 @@ export const buildMariadb = async (mariadb: MariadbNested) => { RollbackConfig, UpdateConfig, Networks, + StopGracePeriod, } = generateConfigContainer(mariadb); const resources = calculateResources({ memoryLimit, @@ -102,6 +103,8 @@ export const buildMariadb = async (mariadb: MariadbNested) => { : [], }, UpdateConfig, + ...(StopGracePeriod !== undefined && + StopGracePeriod !== null && { StopGracePeriod }), }; try { const service = docker.getService(appName); diff --git a/packages/server/src/utils/databases/mongo.ts b/packages/server/src/utils/databases/mongo.ts index b4c36e6eb..000049cf8 100644 --- a/packages/server/src/utils/databases/mongo.ts +++ b/packages/server/src/utils/databases/mongo.ts @@ -91,6 +91,7 @@ ${command ?? "wait $MONGOD_PID"}`; RollbackConfig, UpdateConfig, Networks, + StopGracePeriod, } = generateConfigContainer(mongo); const resources = calculateResources({ @@ -155,6 +156,8 @@ ${command ?? "wait $MONGOD_PID"}`; : [], }, UpdateConfig, + ...(StopGracePeriod !== undefined && + StopGracePeriod !== null && { StopGracePeriod }), }; try { diff --git a/packages/server/src/utils/databases/mysql.ts b/packages/server/src/utils/databases/mysql.ts index a3ed72afc..2956b52e5 100644 --- a/packages/server/src/utils/databases/mysql.ts +++ b/packages/server/src/utils/databases/mysql.ts @@ -51,6 +51,7 @@ export const buildMysql = async (mysql: MysqlNested) => { RollbackConfig, UpdateConfig, Networks, + StopGracePeriod, } = generateConfigContainer(mysql); const resources = calculateResources({ memoryLimit, @@ -108,6 +109,8 @@ export const buildMysql = async (mysql: MysqlNested) => { : [], }, UpdateConfig, + ...(StopGracePeriod !== undefined && + StopGracePeriod !== null && { StopGracePeriod }), }; try { const service = docker.getService(appName); diff --git a/packages/server/src/utils/databases/postgres.ts b/packages/server/src/utils/databases/postgres.ts index 83f65f1c2..1b0d62c0a 100644 --- a/packages/server/src/utils/databases/postgres.ts +++ b/packages/server/src/utils/databases/postgres.ts @@ -44,6 +44,7 @@ export const buildPostgres = async (postgres: PostgresNested) => { RollbackConfig, UpdateConfig, Networks, + StopGracePeriod, } = generateConfigContainer(postgres); const resources = calculateResources({ memoryLimit, @@ -101,6 +102,8 @@ export const buildPostgres = async (postgres: PostgresNested) => { : [], }, UpdateConfig, + ...(StopGracePeriod !== undefined && + StopGracePeriod !== null && { StopGracePeriod }), }; try { const service = docker.getService(appName); diff --git a/packages/server/src/utils/databases/redis.ts b/packages/server/src/utils/databases/redis.ts index 85ae873d4..98c3ba62a 100644 --- a/packages/server/src/utils/databases/redis.ts +++ b/packages/server/src/utils/databases/redis.ts @@ -42,6 +42,7 @@ export const buildRedis = async (redis: RedisNested) => { RollbackConfig, UpdateConfig, Networks, + StopGracePeriod, } = generateConfigContainer(redis); const resources = calculateResources({ memoryLimit, @@ -98,6 +99,8 @@ export const buildRedis = async (redis: RedisNested) => { : [], }, UpdateConfig, + ...(StopGracePeriod !== undefined && + StopGracePeriod !== null && { StopGracePeriod }), }; try {