$ recombobulate _
home / tips / generate-er-diagrams-from-your-database-migrations
0

Generate ER Diagrams from Your Database Migrations

bagwaa @bagwaa · Mar 26, 2026 · Workflows
generate-er-diagrams-from-your-database-migrations

Architecture diagrams are great, but when onboarding a new developer it's the ER diagram they actually want. Claude can generate one straight from your migrations in seconds.

Read the database migrations in database/migrations and generate a Mermaid erDiagram
showing all tables, column names with types, primary keys, and foreign key relationships.

Claude outputs a erDiagram block that renders natively on GitHub, in Notion, and in most documentation tools:

erDiagram
    users {
        int id PK
        string email
        timestamp deleted_at
    }
    orders {
        int id PK
        int user_id FK
        decimal total
        string status
    }
    users ||--o{ orders : "places"

Paste it straight into your README and it just works.

If your schema is large, scope it down:

Only include the core domain tables (users, orders, products, order_items).
Exclude audit logs, jobs, and pivot tables.

You can also ask Claude to update the diagram as part of your workflow whenever you add a new migration — or add it as a post-migration hook.

An up-to-date ER diagram in your README turns a new hire's first week into their first day.

~/recombobulate $ tip --comments --count=0

Log in to leave a comment.

~/recombobulate $ tip --related --limit=3
0
Scan Pending Changes for Security Issues with /security-review

The /security-review command scans your uncommitted changes for injection vectors, auth gaps, hardcoded secrets, and other common vulnerabilities.

bagwaa @bagwaa · 1 hour ago
0
Run Setup Scripts on Every Session with the SessionStart Hook

The SessionStart hook fires when any session begins or resumes, making it ideal for loading environment variables and running one-time setup scripts.

bagwaa @bagwaa · 1 hour ago
0
Write Property-Based Tests with fast-check and Claude

Ask Claude to write property-based tests for your functions using fast-check — it identifies the mathematical invariants in your code and generates tests that cover inputs you'd never enumerate by hand.

bagwaa @bagwaa · 2 hours ago