d1-migration

Generate Cloudflare D1 migration scripts for schema changes.

Updated Dec 16, 2025
One-click install
npx skills add https://github.com/AincFh/my-anime-blog --skill d1-migration
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: d1-migration
Source: https://github.com/AincFh/my-anime-blog/tree/main/.cursor/skills/d1-migration
Command: npx skills add https://github.com/AincFh/my-anime-blog --skill d1-migration

SYSTEM DOCUMENTATION & REQUIREMENTS

生成 Cloudflare D1 数据库迁移文件,包含表创建、索引、外键约束。用于创建新的数据表、修改现有表结构或添加索引。

Frequently Asked Questions about d1-migration

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I generate Cloudflare D1 migration scripts for schema changes?

To generate Cloudflare D1 migration scripts, you define the desired schema changes and the tool produces SQL templates with documented sections and filename conventions tailored for D1 databases.

What is the best way to alter existing tables in a Cloudflare D1 database?

Altering existing tables in a Cloudflare D1 database is handled by generating SQL migration scripts that modify structures, add indexes, or enforce foreign key constraints following D1 guidelines.

Does this D1 migration approach support adding indexes and foreign key constraints?

Yes, D1 migration scripts support adding indexes and defining foreign key constraints, allowing you to evolve database schemas by creating new tables or modifying existing structures.

Can I use standard SQL migration files with Cloudflare D1 or do I need specific templates?

You need D1-specific SQL migration templates that adhere to documented D1 migration guidelines, ensuring correct filename conventions and schema evolution scripts for the Cloudflare D1 platform.

When do I need to create a D1 migration file instead of directly applying SQL?

You need a D1 migration file when evolving database schemas to ensure changes like table creation, structural alterations, and index additions are documented and applied systematically across projects.