This handles the full Cloudflare D1 migration lifecycle with Drizzle ORM, from generating SQL to recovering from stuck migrations. The workflow emphasizes reading generated SQL before applying it because Drizzle sometimes creates destructive table recreations for simple changes like updating a default value. You get commands for local and remote migrations, diagnosis steps for partially applied migrations that get stuck, and fixes for common D1 gotchas like parameter limits on bulk inserts. Worth using if you've ever had a migration fail halfway through or wondered why your local database works but production breaks.

skills.sh installs
1.2K
GitHub stars
1.1K
last updated
Aug 21, 2026

Install

$ npx -y skills add jezweb/claude-skills --skill d1-migration --agent claude-code

Installs into .claude/skills of the current project.

Files

D1 Migration Workflow

Guided workflow for Cloudflare D1 database migrations using Drizzle ORM.

Standard Migration Flow

1. Generate Migration

pnpm db:generate

This creates a new .sql file in drizzle/ (or your configured migrations directory).

2. Inspect the SQL (CRITICAL)

Always read the generated SQL before applying. Drizzle sometimes generates destructive migrations for simple schema changes.

Red Flag: Table Recreation

If you see this pattern, the migration will likely fail:

CREATE TABLE `my_table_new` (...);
INSERT INTO `my_table_new` SELECT ..., `new_column`, ... FROM `my_table`;
--                                      ^^^ This column doesn't exist in old table!
DROP TABLE `my_table`;
ALTER TABLE `my_table_new` RENAME TO `my_table`;

Cause: Changing a column's default value in Drizzle schema triggers full table recreation. The INSERT SELECT references the new column from the old table.

Fix: If you're only adding new columns (no type/constraint changes on existing columns), simplify to:

ALTER TABLE `my_table` ADD COLUMN `new_column` TEXT DEFAULT 'value';

Sponsors

Details

Repository
github.com/jezweb/claude-skills
Categories
Backend & APIs, Debugging, Automation & Workflows, Cloud & Infrastructure, Databases
First seen
May 16, 2026

More from jezweb/claude-skills

All 166
1vintasoftware avatardjango-celery-expertvintasoftware/django-ai-pluginsExpert Django Celery guidance for asynchronous task processing. Use when designing background tasks, configuring Celery workers, handling task retries and error1.2Kskills.sh installs
2heygen-com avatarvideo-translateheygen-com/skillsTranslate and dub existing videos into multiple languages using HeyGen. Use when: (1) Translating a video into another language, (2) Dubbing video content with 1.2Kskills.sh installs
3getsentry avatarsentry-cligetsentry/cliGuide for using the Sentry CLI to interact with Sentry from the command line. Use when the user asks about viewing issues, events, projects, organizations, maki1.2Kskills.sh installs
4spritecook avatarspritecook-workflow-essentialsspritecook/skillsShared workflow rules for SpriteCook. Use together with SpriteCook generation, animation, import, background-removal, and asset-organization workflows for credi1.1Kskills.sh installs
5ruvnet avatarflow-nexus-platformruvnet/rufloComprehensive Flow Nexus platform management - authentication, sandboxes, app deployment, payments, and challenges1.1Kskills.sh installs
6product-on-purpose avatardeliver-acceptance-criteriaproduct-on-purpose/pm-skillsGenerates structured Given/When/Then acceptance criteria for a user story or feature slice, covering the happy path, key failure scenarios, and non-functional e1.1Kskills.sh installs