chore: upgrade PostgreSQL from 13 to 18 in CI and docker-compose (#28252)

* upgrade postgresql from 13 to 18

* wip

* fix: convert Decimal to number in getTotalBookingDuration for PG 16+ compatibility
This commit is contained in:
Benny Joo authored and GitHub committed 2026-03-03 16:00:26 +00:00
1 parent 2bf45677e8
commit 27515d42f0
14 files changed
+19 -15

No files matched your search

@@ -1514,7 +1514,11 @@ export class BookingRepository implements IBookingRepository {
`;
}
return totalBookingTime.totalMinutes ?? 0;
// PostgreSQL 16+ returns `numeric` type from EXTRACT(EPOCH FROM ...) instead of `double precision`.
// Prisma maps `numeric` to a JavaScript Decimal object, which causes string concatenation
// instead of numeric addition when used with the `+` operator (e.g., Decimal(30) + 30 = "3030").
// Explicitly convert to a plain number to ensure correct arithmetic in all callers.
return Number(totalBookingTime.totalMinutes ?? 0);
}
async findOriginalRescheduledBookingUserId({ rescheduleUid }: { rescheduleUid: string }) {
+2 -2
View File
@@ -1,8 +1,8 @@
# this file is a helper to run Cal.com locally
# starts a postgres instance on port 5450 to use as a local db
# starts a postgres 18 instance on port 5450 to use as a local db
services:
postgres:
image: postgres:13
image: postgres:18
ports:
- "5450:5432" # expose pg on port 5450 to not collide with pg from elsewhere
restart: always