Skip to content

chore: Prismaマイグレーションテーブルを削除#144

Merged
KinjiKawaguchi merged 1 commit into
developfrom
chore/remove-prisma-migrations-table
Apr 4, 2026
Merged

chore: Prismaマイグレーションテーブルを削除#144
KinjiKawaguchi merged 1 commit into
developfrom
chore/remove-prisma-migrations-table

Conversation

@KinjiKawaguchi

@KinjiKawaguchi KinjiKawaguchi commented Apr 4, 2026

Copy link
Copy Markdown
Member

Summary

  • Prismaからの移行は完了済みのため、不要になった _prisma_migrations テーブルのスキーマ定義とデータを削除
  • Drizzleマイグレーション(DROP TABLE "_prisma_migrations" CASCADE)を生成

Test plan

  • npm run typecheck が通ること
  • npm run lint が通ること
  • npm run db:generate で差分が出ないこと
  • マイグレーション適用後に _prisma_migrations テーブルが削除されていること

🤖 Generated with Claude Code


Open with Devin

Prismaからの移行は完了しており、_prisma_migrationsテーブルは不要になったため削除する。

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Copilot AI review requested due to automatic review settings April 4, 2026 03:26

@devin-ai-integration devin-ai-integration Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Devin Review found 1 potential issue.

Open in Devin Review

@@ -0,0 +1 @@
DROP TABLE "_prisma_migrations" CASCADE; No newline at end of file

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

📝 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.

Open in Devin Review

Was this helpful? React with 👍 or 👎 to provide feedback.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

Copilot AI Apr 4, 2026

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Suggested change
DROP TABLE "_prisma_migrations" CASCADE;
DROP TABLE IF EXISTS "_prisma_migrations";

Copilot uses AI. Check for mistakes.
@KinjiKawaguchi KinjiKawaguchi merged commit fbd185c into develop Apr 4, 2026
8 checks passed
@KinjiKawaguchi KinjiKawaguchi deleted the chore/remove-prisma-migrations-table branch April 4, 2026 03:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants