# Dbmap Auto On

> Enable automatic database schema map updates. When enabled, DBMAP.md is regenerated every time a database migration command runs in the project.

- Skill: `ariadoss/dbmap-auto-on` (Agent Skill)
- Install (CLI): `npx skillmds@latest add ariadoss/dbmap-auto-on`
- Raw SKILL.md: https://api.skillmd.com/api/skills/ariadoss/dbmap-auto-on/raw
- Safety review: pending
- Works with: Claude Code, Claude.ai, OpenAI Codex
- Category: Coding & Dev Tools
- Author: ariadoss (https://skillmd.com/u/ariadoss)
- Updated: 2026-09-17
- Page: https://skillmd.com/skills/ariadoss/dbmap-auto-on

---

Enable automatic database schema map updates. When enabled, DBMAP.md is regenerated every time a database migration command runs in the project.

The hook fires PostToolUse on `Bash` tool calls and matches common migration commands across frameworks (Rails `db:migrate`, Django `manage.py migrate`, Alembic, Prisma, Knex, Sequelize, Goose, Dbmate, Flyway, Liquibase, TypeORM, Drizzle).

This requires a DSN stored in `.dbmap-auto` so the hook can connect without prompting. **The DSN contains credentials — `.dbmap-auto` must be gitignored.**

Steps:

1. Ask the user which DSN to use. Either run detection:

   ```bash
   "${REPOMAP_HOME:-$HOME/claude-repomap-command}/scripts/run.sh" dbmap --list
   ```

   …and have the user confirm one of the detected connections, or ask them to provide a DSN directly.

2. Write the confirmed DSN to `.dbmap-auto`:

   ```bash
   printf '%s\n' '<confirmed_dsn>' > .dbmap-auto
   ```

3. Ensure `.dbmap-auto` is gitignored:

   ```bash
   touch .gitignore && grep -qxF '.dbmap-auto' .gitignore || printf '\n.dbmap-auto\n' >> .gitignore
   ```

Confirm that auto-updating is now enabled. Remind the user:
- DBMAP.md must already exist — run `/dbmap` first if it doesn't.
- The hook only fires after migration commands actually run; editing a migration file doesn't trigger it (the schema hasn't changed yet).
- Delete `.dbmap-auto` or run `/dbmap-auto-off` to disable.

