Agent skill
db-migrate
Run D1 database migrations for Cloudflare. Use when applying schema changes, creating new tables, or modifying database structure.
Install this agent skill to your Project
npx add-skill https://github.com/majiayu000/claude-skill-registry/tree/main/skills/other/db-migrate-pentatonic-ltd-claude-config
SKILL.md
D1 Database Migrations
Project Database
- Database name:
agentic-commerce-p2p-db - Location:
migrations/directory
List Existing Migrations
ls -la migrations/
Apply Migrations (Remote)
npx wrangler d1 execute agentic-commerce-p2p-db --remote --file=migrations/YOUR_MIGRATION.sql
Apply All Pending Migrations
npx wrangler d1 migrations apply agentic-commerce-p2p-db --remote
Check Current Schema
npx wrangler d1 execute agentic-commerce-p2p-db --remote --command="SELECT name FROM sqlite_master WHERE type='table';"
Creating New Migrations
- Create file:
migrations/NNN_description.sql - Use sequential numbering (e.g., 019, 020)
- Include both up and down if possible
- Test locally first with
--localflag
Local Testing
npx wrangler d1 execute agentic-commerce-p2p-db --local --file=migrations/YOUR_MIGRATION.sql
Rollback
D1 doesn't have built-in rollback. Create a reverse migration manually.
Best Practices
- Always backup before major schema changes
- Test migrations locally first
- Use transactions where possible
- Document breaking changes
Recommended Agent Skills
Expand your agent's capabilities with these related and highly-rated skills.
agent-ops-spec
Manage specification documents in .agent/specs/. Use when user provides requirements, acceptance criteria, or feature descriptions that need to be tracked and validated against implementation.
agent-ops-state
Maintain .agent state files. Use at session start, after meaningful steps, and before concluding: read/update constitution/memory/focus/issues/baseline consistently.
agent-ops-spec
Manage specification documents in .agent/specs/. Use when user provides requirements, acceptance criteria, or feature descriptions that need to be tracked and validated against implementation.
agent-ops-testing
Test strategy, execution, and coverage analysis. Use when designing tests, running test suites, or analyzing test results beyond baseline checks.
agent-ops-testing
Test strategy, execution, and coverage analysis. Use when designing tests, running test suites, or analyzing test results beyond baseline checks.
agent-ops-state
Maintain .agent state files. Use at session start, after meaningful steps, and before concluding: read/update constitution/memory/focus/issues/baseline consistently.
Didn't find tool you were looking for?