---
name: Database Migrations Generator
slug: database-migrations-generator
category: DevOps
description: Database Migrations Generator runs Medusa’s migration command for a specified module and reports the generated files or any errors. Use it when you need to create database migrations before applying them.
github: "https://github.com/medusajs/medusa-agent-skills/tree/main/plugins/medusa-dev/skills/db-generate"
language: JavaScript
stars: 212
forks: 26
install: "npx degit https://github.com/medusajs/medusa-agent-skills/tree/main/plugins/medusa-dev/skills/db-generate ~/.claude/skills/db-generate"
installs_to: ~/.claude/skills/db-generate
source_path: plugins/medusa-dev/skills/db-generate/SKILL.md
collection_size: 18
category_size: 920
collection_url: "https://dirskills.com/collections/medusajs/medusa-agent-skills"
added: 2026-09-04T05:26:11.545Z
last_synced: 2026-09-04T05:26:11.545Z
canonical_url: "https://dirskills.com/skills/database-migrations-generator"
---

# Database Migrations Generator

Database Migrations Generator runs Medusa’s migration command for a specified module and reports the generated files or any errors. Use it when you need to create database migrations before applying them.

**Install:**

```bash
npx degit https://github.com/medusajs/medusa-agent-skills/tree/main/plugins/medusa-dev/skills/db-generate ~/.claude/skills/db-generate
```

## README

# Generate Database Migrations

Generate database migrations for the specified Medusa module.

The user will provide the module name as an argument (e.g., `brand`, `product`, `custom-module`).

For example: `/medusa-dev:db-generate brand`

Use the Bash tool to execute the command `npx medusa db:generate <module-name>`, replacing `<module-name>` with the provided argument.

Report the results to the user, including:

- The module name for which migrations were generated
- Migration file name or location
- Any errors or warnings
- Next steps (running `npx medusa db:migrate` to apply the migrations)
