Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Contributor
There was a problem hiding this comment.
Pull request overview
This PR migrates the application's database layer from Prisma ORM to Drizzle ORM, addressing issues #449 (Prisma dependency updates) and #397 (Prisma v7 migration). The migration involves replacing all Prisma client usages with Drizzle equivalents throughout the codebase, including route handlers, middleware, sync utilities, test fixtures, and data migration scripts.
Changes:
- Replaced Prisma Client with Drizzle ORM for all database operations across the application
- Migrated database schema from Prisma schema to Drizzle schema with TypeScript definitions
- Updated all route handlers and API endpoints to use Drizzle query syntax
- Converted test fixtures and data migration scripts to Drizzle API
Reviewed changes
Copilot reviewed 48 out of 50 changed files in this pull request and generated 16 comments.
Show a summary per file
| File | Description |
|---|---|
| drizzle/schema.ts | New Drizzle schema definitions with table structures and types |
| drizzle/relations.ts | Drizzle relational query definitions for joins |
| drizzle/index.ts | Drizzle client initialization with postgres-js adapter |
| drizzle.config.ts | Drizzle Kit configuration for migrations |
| drizzle/*/migration.sql | Database migration files generated by Drizzle Kit |
| initial.sql | Initial migration setup for Drizzle migrations table |
| app/lib/db.server.ts | Database client exports and orThrow helper extension |
| app/lib/context.server.ts | Updated context from prismaContext to dbContext |
| app/lib/session.server.ts | Migrated session storage from Prisma to Drizzle |
| app/lib/sync/*.server.ts | Updated user/member/guild sync functions to use Drizzle |
| app/lib/schema.ts | Updated type imports from Prisma to Drizzle |
| app/lib/prisma.server.ts | Removed (no longer needed) |
| app/root.tsx | Removed prismaMiddleware, now uses dbContext with default |
| app/routes/*.ts(x) | All route handlers migrated to Drizzle queries |
| tests/fixtures.ts | Test fixtures converted to Drizzle API |
| scripts/import.ts | Data import script converted to Drizzle |
| scripts/export.ts | Data export script converted to Drizzle |
| scripts/vitex | New script runner using Vite |
| scripts/generateTrampolineKey.ts | Added missing crypto import |
| tsconfig.json | Changed to emitDeclarationOnly with outDir |
| package.json | Added drizzle-orm and drizzle-kit dependencies |
| .prettierignore | Added Drizzle snapshot files to ignore list |
Comments suppressed due to low confidence (1)
package.json:81
- The package.json still contains Prisma dependencies (@prisma/adapter-pg, @prisma/client, @prisma/generator-helper, prisma, prisma-json-types-generator) even though the codebase has migrated to Drizzle. These dependencies should be removed as they're no longer used and will unnecessarily increase the bundle size and dependency count.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
closes: #449
closes: #397