Skip to content

chore: migrate from prisma-erd-generator to prisma-markdown v1.0.9 (#3421)#3422

Merged
KATO-Hiro merged 4 commits into
stagingfrom
#3421
Apr 16, 2026
Merged

chore: migrate from prisma-erd-generator to prisma-markdown v1.0.9 (#3421)#3422
KATO-Hiro merged 4 commits into
stagingfrom
#3421

Conversation

@KATO-Hiro

@KATO-Hiro KATO-Hiro commented Apr 16, 2026

Copy link
Copy Markdown
Collaborator

close #3421

Summary by CodeRabbit

リリースノート

  • Documentation

    • ERDドキュメント生成ツールの移行計画を追加しました。
    • SQL CHECK制約に関するドキュメントガイダンスを更新しました。
  • Chores

    • 依存関係を更新しました。
    • ERD図の出力形式を標準的なMermaid形式に変更しました。

KATO-Hiro and others added 2 commits April 16, 2026 13:35
- Remove prisma-erd-generator (Puppeteer/mermaid-cli dependency)
- Remove @mermaid-js/mermaid-cli (only used by prisma-erd-generator)
- Remove @popperjs/core (no direct import; installed transitively via flowbite)
- Add prisma-markdown@1.0.9 (single dep: @prisma/generator-helper, Prisma v5 compatible)
- ERD.md output format changes from emoji-annotated Mermaid to standard Mermaid + Markdown

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…risma-erd-generator

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@coderabbitai

coderabbitai Bot commented Apr 16, 2026

Copy link
Copy Markdown
Contributor
📝 Walkthrough

Walkthrough

Prismaのエンティティ関連図(ERD)生成ツールをprisma-erd-generatorからprisma-markdownへ移行しました。依存関係を更新し、Prismaジェネレータ設定を変更し、ERD.mdの出力フォーマットをMermaid ER図から標準Markdown形式へ修正しました。

Changes

Cohort / File(s) Summary
ジェネレータ移行
prisma/schema.prisma, package.json
prisma-erd-generatorを削除し、prisma-markdown@1.0.9を追加。ジェネレータ設定をerdからmarkdownへ置き換え、theme/includeRelationFromFieldsオプションを削除。
出力フォーマット変更(高注視)
prisma/ERD.md
Mermaid ER図を標準Markdown構造に変更。絵文字付きテーブル定義を削除し、制約アノテーション(PK、UK、FK、nullable)を列に直接追記。「CHECK constraints」セクションをモデル別「Properties」サブセクションに変更。
ドキュメント・ガイドライン
.claude/rules/prisma-db.md, docs/dev-notes/2026-04-16/migrate-erd-generator/plan.md
ERD.md上書きツールの説明を更新。詳細な移行ステップ、依存関係削除・追加内容、実行コマンド、検証手順を含む移行計画ドキュメントを追加。

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes


📜✨ ERDジェネレーター新世代へ
古きツールから新きへ乗り換え
セキュリティ強く、フォーマット清く
Markdownの光、輝き始める 🌟

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed PR タイトルは、prisma-erd-generator から prisma-markdown v1.0.9 への移行という主要な変更を明確かつ簡潔に要約している。
Linked Issues check ✅ Passed PR は #3421 で指定された目標を完全に達成している:保守されていない ERD ジェネレーターを移行し、セキュリティリスクを軽減している。
Out of Scope Changes check ✅ Passed すべての変更は ERD ジェネレーターの移行に関連している。ドキュメント更新、package.json の依存関係の変更、schema.prisma の設定変更、ERD.md の出力フォーマット更新は、すべて移行の範囲内。
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch #3421

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

@coderabbitai coderabbitai Bot 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.

Actionable comments posted: 2

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@prisma/ERD.md`:
- Around line 1-7: Fix Markdown lint warnings by adding blank lines around the
affected headings and fenced code block and ensuring the file ends with a
newline: insert a blank line before and after the "# AtCoder NoviSteps ERD"
heading (MD022), ensure there's an empty line both immediately before and after
the "```mermaid" fenced code block (MD031), and add a trailing newline at EOF so
the file ends with a newline character (MD047); update the ERD markdown
accordingly.
- Around line 301-329: The ERD is missing the CHECK constraint notes that were
manually added in migration.sql for the tables votegrade, votedgradecounter, and
votedgradestatistics; update prisma/ERD.md by appending a constraints summary
section (at the end of the file) listing each CHECK added in migration.sql
(e.g., votegrade: CHECK (grade != 'PENDING'), votedgradecounter: CHECK (grade !=
'PENDING'), votedgradecounter: CHECK (count >= 0), votedgradestatistics: CHECK
(grade != 'PENDING')), and optionally add a small script or npm task that
automatically appends or validates these constraint comments after ERD
generation so future manual migrations are recorded consistently.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro

Run ID: 9dcdbfe9-0bfb-4c7c-a830-e9d673e869f3

📥 Commits

Reviewing files that changed from the base of the PR and between f5738eb and eaf77d2.

⛔ Files ignored due to path filters (1)
  • pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml, !pnpm-lock.yaml
📒 Files selected for processing (5)
  • .claude/rules/prisma-db.md
  • docs/dev-notes/2026-04-16/migrate-erd-generator/plan.md
  • package.json
  • prisma/ERD.md
  • prisma/schema.prisma

Comment thread prisma/ERD.md
Comment thread prisma/ERD.md

@KATO-Hiro KATO-Hiro left a comment

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

LGTM

@KATO-Hiro KATO-Hiro merged commit b95c6de into staging Apr 16, 2026
3 checks passed
@KATO-Hiro KATO-Hiro deleted the #3421 branch April 16, 2026 13:53
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.

[Deps] ERD ジェネレーターを移行しましょう

1 participant