home / skills / medusajs / medusa-agent-skills / db-migrate
This skill runs Medusa database migrations and reports applied migrations, errors, and success using the Bash tool to guide deployment.
npx playbooks add skill medusajs/medusa-agent-skills --skill db-migrateReview the files below or copy the command above to add this skill to your agents.
---
name: db-migrate
description: Run database migrations in Medusa
allowed-tools: Bash(npx medusa db:migrate:*)
---
# Run Database Migrations
Execute the Medusa database migration command to apply pending migrations.
Use the Bash tool to execute: `npx medusa db:migrate`
Report the migration results to the user, including:
- Number of migrations applied
- Any errors that occurred
- Success confirmation
This skill runs Medusa database migrations and reports results back to the user. It executes the Medusa CLI migration command, captures output, and summarizes what changed. The goal is clear, actionable feedback about applied migrations and any errors.
The skill invokes the Medusa CLI migration command (npx medusa db:migrate) via a shell execution tool. It parses the command output to count applied migrations, detect errors or warnings, and extract success confirmations. Finally, it returns a concise summary with counts, error details, and suggested next steps.
What command does this skill run?
It runs npx medusa db:migrate using a shell execution tool.
What information will I get after running migrations?
You receive the number of migrations applied, any error messages or stack traces, and a success confirmation or next-step recommendations.