chore(deps): update prisma to v7 (major)#2900
chore(deps): update prisma to v7 (major)#2900tobiasdiez merged 11 commits intorenovate/major-prismafrom
Conversation
- Remove url from schema.prisma datasource (no longer supported) - Remove deprecated previewFeatures from generator block - Add datasource config to prisma.config.ts with conditional env var - Add migrations.path to prisma.config.ts - Update nuxt.config.ts User mapper to use generated client path - Update prisma:migrate:diff script to use --to-schema (renamed flag) - Remove --shadow-database-url CLI flag (now configured in prisma.config.ts) - Update CI workflow to pass NUXT_DATABASE_URL to migrate:diff step Co-authored-by: tobiasdiez <5037600+tobiasdiez@users.noreply.github.com>
a3a13d4 to
35d892e
Compare
|
@copilot Fix: Run pnpm prisma:push
[dotenv@17.3.1] injecting env (0) from .env -- tip: ⚙️ override existing env vars with { override: true } Prisma schema loaded from server/database/schema.prisma. and during build (on windows) Error: File URL path must be absolute This can be fixed by porting the patch to prisma to the new version. |
35d892e to
fbf2c36
Compare
- Remove shadowDatabaseUrl from prisma.config.ts when unused (was causing prisma:push to fail) - Add NUXT_SHADOW_DATABASE_URL support as a separate env var for migrate:diff only - Update CI: add SHADOW_DATABASE_URL env and step to create jabref_shadow database - Update prisma.patch for v7.4.2 (fix fileURLToPath in generated ESM client code) - Update @prisma/client patch for v7.4.2 (fix error re-throwing in runtime) - Remove old unversioned patch entries (v6) from package.json patchedDependencies Co-authored-by: tobiasdiez <5037600+tobiasdiez@users.noreply.github.com>
... Fixed both issues in commit 36c01a1: 1.
2. Windows build
|
🔗 Linked issue
📚 Description
Completes the Prisma v7 migration per the official upgrade guide.
Schema / generator
urlfromdatasourceblock inschema.prisma(no longer valid in v7)previewFeatures = ["queryCompiler", "driverAdapters"](now stable/default)prisma.config.tsdatasourceblock withurlfromNUXT_DATABASE_URLand optionalshadowDatabaseUrlfromNUXT_SHADOW_DATABASE_URL(only used for schema drift detection, kept separate to avoidprisma db pushfailing when shadow DB equals main DB)prisma generateworks without a live DB (required for the lint CI job)migrations.pathnuxt.config.tsUsermapper:@prisma/client/index.d#User→./database#User(model types are no longer exported from@prisma/clientin v7; they live in the generated output)package.jsonprisma:migrate:diff: replace removed--to-schema-datamodelwith--to-schema; drop--shadow-database-urlCLI flag (now inprisma.config.ts)prismaand@prisma/clientpatch entries with versionedprisma@7.4.2and@prisma/client@7.4.2entriespatches/prisma@7.4.2.patch: replacesglobalThis['__dirname'] = path.dirname(fileURLToPath(import.meta.url))withglobalThis['__dirname'] = "DOESNOTEXIST"in the code generator template, fixing the Windows build error (File URL path must be absolutein prerendering)@prisma__client@7.4.2.patch: addsthrow t;at the start ofhandleRequestErrorinruntime/client.jsandruntime/client.mjs(ported from the v6 patch with updated variable names)CI (
.github/workflows/ci.yml)SHADOW_DATABASE_URLenv var pointing to a separatejabref_shadowdatabasejabref_shadowdatabase before schema drift detection (Prisma v7 no longer auto-creates the shadow database formigrate diff)NUXT_DATABASE_URLandNUXT_SHADOW_DATABASE_URLenv vars into the drift-detection step✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.