Skip to content

Scheduling infrastructure for absolutely everyone.

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

Benny Joo27515d42f095
diff --git a/.github/workflows/api-v1-production-build.yml b/.github/workflows/api-v1-production-build.yml
index 02e534ce24f..4b394599e9f 100644
--- a/.github/workflows/api-v1-production-build.yml
+++ b/.github/workflows/api-v1-production-build.yml
@@ -47,7 +47,7 @@ jobs:
timeout-minutes: 30
services:
postgres:
- image: postgres:13
+ image: postgres:18
credentials:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
diff --git a/.github/workflows/api-v2-production-build.yml b/.github/workflows/api-v2-production-build.yml
index fe25f6604d5..0611f100e86 100644
--- a/.github/workflows/api-v2-production-build.yml
+++ b/.github/workflows/api-v2-production-build.yml
@@ -18,7 +18,7 @@ jobs:
timeout-minutes: 30
services:
postgres:
- image: postgres:13
+ image: postgres:18
credentials:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
diff --git a/.github/workflows/check-prisma-migrations.yml b/.github/workflows/check-prisma-migrations.yml
index 3bee03151b8..bddb9fd84ee 100644
--- a/.github/workflows/check-prisma-migrations.yml
+++ b/.github/workflows/check-prisma-migrations.yml
@@ -11,7 +11,7 @@ jobs:
runs-on: blacksmith-2vcpu-ubuntu-2404
services:
postgres:
- image: postgres:13
+ image: postgres:18
credentials:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
diff --git a/.github/workflows/e2e-api-v2.yml b/.github/workflows/e2e-api-v2.yml
index 5c05003be70..cbee6ae91ad 100644
--- a/.github/workflows/e2e-api-v2.yml
+++ b/.github/workflows/e2e-api-v2.yml
@@ -36,7 +36,7 @@ jobs:
runs-on: blacksmith-4vcpu-ubuntu-2404
services:
postgres:
- image: postgres:13
+ image: postgres:18
credentials:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
diff --git a/.github/workflows/e2e-app-store.yml b/.github/workflows/e2e-app-store.yml
index a89e2e9124c..a8422e68d04 100644
--- a/.github/workflows/e2e-app-store.yml
+++ b/.github/workflows/e2e-app-store.yml
@@ -48,7 +48,7 @@ jobs:
runs-on: blacksmith-4vcpu-ubuntu-2404
services:
postgres:
- image: postgres:13
+ image: postgres:18
credentials:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
diff --git a/.github/workflows/e2e-embed-react.yml b/.github/workflows/e2e-embed-react.yml
index e6dc9baabe8..d76a18aafd1 100644
--- a/.github/workflows/e2e-embed-react.yml
+++ b/.github/workflows/e2e-embed-react.yml
@@ -48,7 +48,7 @@ jobs:
runs-on: blacksmith-4vcpu-ubuntu-2404
services:
postgres:
- image: postgres:13
+ image: postgres:18
credentials:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
diff --git a/.github/workflows/e2e-embed.yml b/.github/workflows/e2e-embed.yml
index 3ae85bdd5a0..12682bc6144 100644
--- a/.github/workflows/e2e-embed.yml
+++ b/.github/workflows/e2e-embed.yml
@@ -48,7 +48,7 @@ jobs:
runs-on: blacksmith-4vcpu-ubuntu-2404
services:
postgres:
- image: postgres:13
+ image: postgres:18
credentials:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
diff --git a/.github/workflows/e2e.yml b/.github/workflows/e2e.yml
index 9d6f702179f..1dc4b10e2c0 100644
--- a/.github/workflows/e2e.yml
+++ b/.github/workflows/e2e.yml
@@ -48,7 +48,7 @@ jobs:
runs-on: blacksmith-4vcpu-ubuntu-2404
services:
postgres:
- image: postgres:13
+ image: postgres:18
credentials:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
diff --git a/.github/workflows/integration-tests.yml b/.github/workflows/integration-tests.yml
index 7f8b5b83b66..a67e2e99849 100644
--- a/.github/workflows/integration-tests.yml
+++ b/.github/workflows/integration-tests.yml
@@ -48,7 +48,7 @@ jobs:
runs-on: blacksmith-2vcpu-ubuntu-2404
services:
postgres:
- image: postgres:13
+ image: postgres:18
credentials:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
diff --git a/.github/workflows/setup-db.yml b/.github/workflows/setup-db.yml
index b0667355b60..22d41cb5c14 100644
--- a/.github/workflows/setup-db.yml
+++ b/.github/workflows/setup-db.yml
@@ -30,7 +30,7 @@ jobs:
timeout-minutes: 15
services:
postgres:
- image: postgres:13
+ image: postgres:18
credentials:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
diff --git a/apps/api/v1/test/docker-compose.yml b/apps/api/v1/test/docker-compose.yml
index de160dc7d9c..249ac4df98f 100644
--- a/apps/api/v1/test/docker-compose.yml
+++ b/apps/api/v1/test/docker-compose.yml
@@ -1,7 +1,7 @@
# The containers that compose the project
services:
db:
- image: postgres:13
+ image: postgres:18
restart: always
container_name: integration-tests-prisma
ports:
diff --git a/apps/web/test/docker-compose.yml b/apps/web/test/docker-compose.yml
index de160dc7d9c..249ac4df98f 100644
--- a/apps/web/test/docker-compose.yml
+++ b/apps/web/test/docker-compose.yml
@@ -1,7 +1,7 @@
# The containers that compose the project
services:
db:
- image: postgres:13
+ image: postgres:18
restart: always
container_name: integration-tests-prisma
ports:
diff --git a/packages/features/bookings/repositories/BookingRepository.ts b/packages/features/bookings/repositories/BookingRepository.ts
index e336f70d6a0..a373b99a834 100644
--- a/packages/features/bookings/repositories/BookingRepository.ts
+++ b/packages/features/bookings/repositories/BookingRepository.ts
@@ -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 }) {
diff --git a/packages/prisma/docker-compose.yml b/packages/prisma/docker-compose.yml
index ffb00efd38a..9b21817d6c3 100644
--- a/packages/prisma/docker-compose.yml
+++ b/packages/prisma/docker-compose.yml
@@ -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