-
Notifications
You must be signed in to change notification settings - Fork 0
feat/ migrate to drizzle #34
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
…d add new dependencies
…r database integration
…tory for data handling
…ockerRepository for data retrieval
…rRepository for data operations
…o LostItemRepository for data operations
|
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
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 PR migrates the API’s database layer from Prisma to Drizzle ORM by removing old Prisma files and introducing new Drizzle schema definitions and migration scripts.
- Removed Prisma files and related configurations
- Added new Drizzle schema definitions for users, lost items, lockers, and drawers
- Updated package.json scripts, migration files, and integration modules to use Drizzle ORM
Reviewed Changes
Copilot reviewed 49 out of 49 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| apps/api/src/infra/drizzle/schema/users.ts | Defines the users table with Drizzle ORM using enums from _common.ts |
| apps/api/src/infra/drizzle/schema/lost-items.ts | Defines the lost_items table, including a unique index on drawerId |
| apps/api/src/infra/drizzle/schema/lockers.ts | Defines the lockers table |
| apps/api/src/infra/drizzle/schema/drawers.ts | Defines the drawers table with a foreign key to lockers |
| apps/api/src/infra/drizzle/schema/_common.ts | Provides common enums for lostAndFoundState and userRole |
| apps/api/src/infra/drizzle/index.ts | Exports schema components |
| apps/api/src/infra/drizzle/drizzle.service.ts | Implements the Drizzle client provider |
| apps/api/src/infra/drizzle/drizzle.module.ts | Wraps Drizzle providers into a NestJS module |
| apps/api/src/common/constant/injection-token.ts | Adds the DRIZZLE_CLIENT injection token |
| apps/api/src/app/app.module.ts | Integrates DrizzleModule into the main application module |
| apps/api/package.json | Updates DB scripts and dependencies to switch to Drizzle ORM |
| apps/api/drizzle/migrations/* | Introduces new migration scripts and snapshots for Drizzle |
| apps/api/drizzle.config.ts | Provides configuration for Drizzle migrations |
| .github/workflows/db-push-migration.yaml | Removes the old Prisma migration workflow configuration |
Comments suppressed due to low confidence (1)
apps/api/src/infra/drizzle/schema/lost-items.ts:25
- The unique index on 'drawerId' may prevent multiple lost items from being associated with the same drawer. Verify that this constraint is intended or consider removing the uniqueness requirement if multiple items per drawer are allowed.
uniqueIndex('lost_items_drawer_id_key').using('btree', table.drawerId.asc().nullsLast().op('int4_ops'))
…tItemRepository for similarity sorting
⭐️ Overview(概要)
Drizzleへの移行
📝 Changes Made(変更点)
🗺️ Scope of Impact(影響範囲)
Worning
本番環境で動くか未確認(デバック方法がわからないため)
DBのmigrationも行っていない
行う時はスナップショットを絶対にとること