fix(deploy): migrate after stop and shrink DB pool

Stage migrate hit ER_CON_COUNT_ERROR while live still held the pool. Build in stage with DATABASE_POOL_SIZE=5, run db:migrate only after stopping the service (with retries), and lower the default pool from 40 to 10.

Co-authored-by: Cursor <[email protected]>
This commit is contained in:
2026-07-21 21:44:06 +02:00
co-authored by Cursor
parent 687e1f9fb0
commit fa40eebeed
4 changed files with 34 additions and 7 deletions
+1 -1
View File
@@ -8,7 +8,7 @@ const schema = z.object({
.enum(["development", "test", "production"])
.default("development"),
DATABASE_URL: z.string().url(),
DATABASE_POOL_SIZE: z.coerce.number().int().positive().default(40),
DATABASE_POOL_SIZE: z.coerce.number().int().positive().default(10),
DATABASE_IDLE_TIMEOUT_MS: z.coerce.number().int().positive().default(300_000),
DATABASE_CONNECT_TIMEOUT_MS: z.coerce
.number()