db-generate

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

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)
为指定的Medusa模块生成数据库迁移文件。
用户会提供模块名称作为参数(例如:
brand
product
custom-module
)。
示例:
/medusa-dev:db-generate brand
使用Bash工具执行命令
npx medusa db:generate <module-name>
,将
<module-name>
替换为提供的参数。
向用户报告结果,包括:
  • 生成迁移文件的模块名称
  • 迁移文件名称或位置
  • 任何错误或警告
  • 后续步骤(运行
    npx medusa db:migrate
    以应用迁移文件)