-
Notifications
You must be signed in to change notification settings - Fork 8
Updating Prisma ORM and Prisma Client #2172
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
Signed-off-by: Dian Deskov <[email protected]>
Signed-off-by: Dian Deskov <[email protected]>
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #2172 +/- ##
==========================================
- Coverage 99.85% 99.85% -0.01%
==========================================
Files 175 175
Lines 6832 6830 -2
Branches 1303 1315 +12
==========================================
- Hits 6822 6820 -2
Misses 10 10
🚀 New features to boost your workflow:
|
Signed-off-by: Dian Deskov <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This pull request upgrades Prisma ORM and Prisma Client from version 6 to version 7, following the official migration guide. The upgrade introduces breaking changes that required updates to configuration, imports, and build processes.
Changes:
- Upgraded Prisma packages from 6.2.1 to 7.2.0 and added the @prisma/adapter-better-sqlite3 adapter
- Modified Prisma client generation to use a custom output path (src/generated/prisma) instead of node_modules
- Updated build configurations (Vite, TypeScript) to handle the new Prisma client location with proper aliasing
- Added CI pipeline step to generate Prisma client before running tests
Reviewed changes
Copilot reviewed 16 out of 19 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| front-end/package.json | Updated Prisma packages to version 7.2.0, added adapter package, and better-sqlite3 override |
| front-end/prisma/schema.prisma | Updated generator to use custom output path and driverAdapters preview feature |
| front-end/prisma.config.ts | Added Prisma 7 configuration file for schema and migrations paths |
| front-end/vite.config.ts | Added Prisma client aliasing for browser and client builds with external filtering |
| front-end/tsconfig.*.json | Updated TypeScript path mappings to point to generated Prisma client location |
| front-end/src/main/db/prisma.ts | Updated to use adapter pattern with type assertion for constructor parameters |
| front-end/src/tests/main/db/prisma.spec.ts | Updated tests to mock adapter and verify new initialization pattern |
| front-end/electron-builder.yml | Updated asset paths for generated Prisma client location |
| .github/workflows/test-frontend.yaml | Added Prisma client generation step before running tests |
| .gitignore | Added generated Prisma client directory to ignore list |
| NOTICE | Updated dependency attribution entries (license compliance) |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
rbarker-dev
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Approve changes to test-frontend.yaml and .gitignore.
There's a snyk error that needs resolving though.
PROBLEM
CI pipeline was printing a requirement to update Prisma to the latest version. Upgrading to newer version introduced breaking changes.
SOLUTION
Version updated from 6 to 7 by following the guide https://www.prisma.io/docs/orm/more/upgrade-guides/upgrading-versions/upgrading-to-prisma-7
Solution was manually tested locally and appears to be working.
Solution passes the db and Prisma related tests.