db-generate
medusajs/medusa-agent-skills
Generate database migrations for Medusa modules with a single command.
What is db-generate?
This skill automates the creation of database migrations for Medusa modules. Use it when you need to generate migration files for a new or modified module before applying them to your database.
- Generates database migration files for specified Medusa modules
- Executes the npx medusa db:generate command with module name argument
- Reports migration file names and locations
- Identifies errors or warnings during generation
- Suggests next steps for applying migrations
How to install db-generate
npx skills add https://github.com/medusajs/medusa-agent-skills --skill db-generate- Medusa project initialized and configured
- Node.js and npm installed
- Access to Medusa CLI tools
How to use db-generate
- 1.Identify the module name you need to generate migrations for (e.g., 'brand', 'product', 'custom-module')
- 2.Invoke the skill with the module name as argument: /medusa-dev:db-generate <module-name>
- 3.Review the generated migration file name and location in the output
- 4.Check for any errors or warnings reported
- 5.Run npx medusa db:migrate to apply the generated migrations to your database
Use cases
- Create migrations when adding a new custom module to your Medusa store
- Generate migrations after modifying module database schema
- Prepare migration files before running database updates
- Automate migration creation in development workflows
- Medusa developers building custom modules
- Backend engineers managing Medusa database schemas
- DevOps engineers automating Medusa deployments
db-generate FAQ
You can use any Medusa module name, including built-in modules (product, brand, etc.) or custom module names you've created in your project.
Migration files are generated in your Medusa project's migrations directory. The exact location and filename are reported in the skill output.
After generation, review the migration file for correctness, then run npx medusa db:migrate to apply the migrations to your database.
Yes, you can edit migration files after generation to customize them before applying them to your database.
Full instructions (SKILL.md)
Source of truth, from medusajs/medusa-agent-skills.
name: db-generate description: Generate database migrations for a Medusa module argument-hint: <module-name> allowed-tools: Bash(npx medusa db:generate:*)
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:migrateto apply the migrations)
Related skills
More from medusajs/medusa-agent-skills and the wider catalog.

db-migrate
Execute Medusa database migrations to apply pending schema changes.

learning-medusa
Interactive bootcamp-style tutorial for learning Medusa development by building a brands feature.

new-user
Create a new admin user in Medusa with email and password.

storefront-best-practices
Essential patterns and integration guidance for building modern ecommerce storefronts with any framework.

eastmoney_financial_data
本 Skill 基于东方财富权威数据库及最新行情底层数据构建,支持通过自然语言查询行情类数据(股票、行业、板块、指数、基金、债券的实时行情、主力资金流向、估值等)、财务类数据(上市公司基本信息、财务指标、高管信息、主营业务等)、关系与经营类数据(关联关系、企业经营数据)。避免模型基于过时知识回答金融数据问题,提供权威及时的金融数据。

mem0
Persistent memory layer for AI apps—store, retrieve, and manage user context across conversations.