chore: Prismaマイグレーションテーブルを削除#144
Conversation
Prismaからの移行は完了しており、_prisma_migrationsテーブルは不要になったため削除する。 Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
| @@ -0,0 +1 @@ | |||
| DROP TABLE "_prisma_migrations" CASCADE; No newline at end of file | |||
There was a problem hiding this comment.
📝 Info: CASCADE on DROP TABLE is safe but worth noting
The migration at drizzle/0004_loose_wasp.sql:1 uses DROP TABLE "_prisma_migrations" CASCADE. The CASCADE keyword will also drop any objects that depend on this table (e.g., views, foreign keys referencing it). Since _prisma_migrations is an internal Prisma bookkeeping table with no foreign key references from other tables (confirmed by inspecting the snapshot), CASCADE has no practical effect here beyond a simple DROP TABLE. It's not a bug, but in general, using CASCADE on production drops warrants a second look to ensure nothing unexpected is removed.
Was this helpful? React with 👍 or 👎 to provide feedback.
There was a problem hiding this comment.
Pull request overview
Prisma 移行完了後に残っていた _prisma_migrations テーブルを、Drizzle 側のスキーマ定義およびマイグレーションで削除して、DBスキーマ管理を Drizzle に一本化するPRです。
Changes:
- Drizzle の
schema.tsから_prisma_migrationsテーブル定義を削除 - Drizzle マイグレーション
0004で_prisma_migrationsを DROP - Drizzle の meta(snapshot / journal)を更新
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| src/infrastructure/drizzle/schema.ts | _prisma_migrations のテーブル定義を削除し、現行スキーマ定義から切り離し |
| drizzle/0004_loose_wasp.sql | _prisma_migrations テーブル削除を行うマイグレーションを追加 |
| drizzle/meta/0004_snapshot.json | _prisma_migrations 削除後のスナップショットを追加 |
| drizzle/meta/_journal.json | 新規マイグレーション 0004_loose_wasp をジャーナルに追加 |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| @@ -0,0 +1 @@ | |||
| DROP TABLE "_prisma_migrations" CASCADE; No newline at end of file | |||
There was a problem hiding this comment.
DROP TABLE "_prisma_migrations" CASCADE is more destructive than necessary here and can silently drop dependent objects (views, FKs, etc.) if they exist. Consider using DROP TABLE IF EXISTS "_prisma_migrations" (without CASCADE) so the migration is idempotent and fails loudly if something unexpectedly depends on the table.
| DROP TABLE "_prisma_migrations" CASCADE; | |
| DROP TABLE IF EXISTS "_prisma_migrations"; |
Summary
_prisma_migrationsテーブルのスキーマ定義とデータを削除DROP TABLE "_prisma_migrations" CASCADE)を生成Test plan
npm run typecheckが通ることnpm run lintが通ることnpm run db:generateで差分が出ないこと_prisma_migrationsテーブルが削除されていること🤖 Generated with Claude Code