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:
@@ -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 }}
|
||||
|
||||
@@ -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 }}
|
||||
|
||||
@@ -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 }}
|
||||
|
||||
@@ -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 }}
|
||||
|
||||
@@ -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 }}
|
||||
|
||||
@@ -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 }}
|
||||
|
||||
@@ -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 }}
|
||||
|
||||
@@ -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 }}
|
||||
|
||||
@@ -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 }}
|
||||
|
||||
@@ -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 }}
|
||||
|
||||
@@ -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:
|
||||
|
||||
@@ -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:
|
||||
|
||||
@@ -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 }) {
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user