FIXED - Drop leftover Prisma ?schema=public from the DB URL
CI / quality (push) Waiting to run

- postgres.js forwarded schema as a startup param; Postgres rejected the connection
- Remove ?schema=public from docker-compose, CI, and the client default
- Strip any query string in lib/db/index.ts so this cannot recur
This commit is contained in:
Moh
2026-08-08 03:04:26 +02:00
parent 1264b577a1
commit 0f436ec05a
3 changed files with 8 additions and 5 deletions
+1 -1
View File
@@ -8,7 +8,7 @@ jobs:
quality: quality:
runs-on: ubuntu-latest runs-on: ubuntu-latest
env: env:
DATABASE_URL: postgresql://postgres:postgres@localhost:5432/moh_sass?schema=public DATABASE_URL: postgresql://postgres:postgres@localhost:5432/moh_sass
NEXT_TELEMETRY_DISABLED: "1" NEXT_TELEMETRY_DISABLED: "1"
steps: steps:
- name: Checkout - name: Checkout
+1 -1
View File
@@ -14,7 +14,7 @@ services:
NEXT_PUBLIC_ADMIN_URL: ${NEXT_PUBLIC_ADMIN_URL:-https://root.mohfarawati.de} NEXT_PUBLIC_ADMIN_URL: ${NEXT_PUBLIC_ADMIN_URL:-https://root.mohfarawati.de}
ADMIN_HOST: ${ADMIN_HOST:-root.mohfarawati.de} ADMIN_HOST: ${ADMIN_HOST:-root.mohfarawati.de}
SITE_RUNTIME_ORIGIN: ${SITE_RUNTIME_ORIGIN:-http://127.0.0.1:3000} SITE_RUNTIME_ORIGIN: ${SITE_RUNTIME_ORIGIN:-http://127.0.0.1:3000}
DATABASE_URL: postgresql://postgres:postgres@db:5432/moh_sass?schema=public DATABASE_URL: postgresql://postgres:postgres@db:5432/moh_sass
ADMIN_PASSWORD: ${ADMIN_PASSWORD:?ADMIN_PASSWORD must be set in .env} ADMIN_PASSWORD: ${ADMIN_PASSWORD:?ADMIN_PASSWORD must be set in .env}
ADMIN_AUTH_SECRET: ${ADMIN_AUTH_SECRET:?ADMIN_AUTH_SECRET must be set in .env (use a long random string)} ADMIN_AUTH_SECRET: ${ADMIN_AUTH_SECRET:?ADMIN_AUTH_SECRET must be set in .env (use a long random string)}
ADMIN_BASIC_AUTH_USER: ${ADMIN_BASIC_AUTH_USER:?ADMIN_BASIC_AUTH_USER must be set in .env} ADMIN_BASIC_AUTH_USER: ${ADMIN_BASIC_AUTH_USER:?ADMIN_BASIC_AUTH_USER must be set in .env}
+6 -3
View File
@@ -8,9 +8,12 @@ import * as schema from "./schema";
* used by the other projects. Replaces the old Prisma client (`lib/prisma.ts`). * used by the other projects. Replaces the old Prisma client (`lib/prisma.ts`).
* A single connection is reused across hot reloads in dev. * A single connection is reused across hot reloads in dev.
*/ */
const connectionString = // Strip any query string (e.g. a leftover Prisma `?schema=public`) — postgres.js
process.env.DATABASE_URL ?? // forwards unknown params to the server as startup options and Postgres rejects
"postgresql://postgres:postgres@localhost:5432/moh_sass?schema=public"; // them ("unrecognized configuration parameter"). `public` is the default schema.
const connectionString = (
process.env.DATABASE_URL ?? "postgresql://postgres:postgres@localhost:5432/moh_sass"
).split("?")[0];
const globalForDb = globalThis as unknown as { const globalForDb = globalThis as unknown as {
dbClient: ReturnType<typeof postgres> | undefined; dbClient: ReturnType<typeof postgres> | undefined;