bobmatnyc avatar

Drizzle Migrations

This teaches a migration-first workflow with Drizzle ORM where you write SQL migrations before touching TypeScript code. The approach treats SQL as the source of truth and generates TypeScript types from it, which prevents schema drift and makes rollbacks cleaner. You'll find detailed patterns for the complete workflow: writing SQL migrations with proper naming conventions, generating TypeScript definitions, organizing schemas by domain, and setting up CI checks to catch drift. It's opinionated about avoiding code-first development, which makes sense if you've ever dealt with environments getting out of sync. The staging checklist and GitHub Actions example are helpful for teams that need migration validation before production deploys.

skills.sh installs
1.3K
GitHub stars
79
last updated
Aug 21, 2026

Install

$ npx -y skills add bobmatnyc/claude-mpm-skills --skill drizzle-migrations --agent claude-code

Installs into .claude/skills of the current project.

Files

Drizzle ORM Database Migrations (TypeScript)

Migration-first database development workflow using Drizzle ORM for TypeScript/JavaScript projects.

When to Use This Skill

Use this skill when:

  • Working with Drizzle ORM in TypeScript/JavaScript projects
  • Need to create or modify database schema
  • Want migration-first development workflow
  • Setting up new database tables or columns
  • Need to ensure schema consistency across environments

Core Principle: Migration-First Development

Critical Rule: Schema changes ALWAYS start with migrations, never code-first.

Why Migration-First?

  • ✅ SQL migrations are the single source of truth
  • ✅ Prevents schema drift between environments
  • ✅ Enables rollback and versioning
  • ✅ Forces explicit schema design decisions
  • ✅ TypeScript types generated from migrations
  • ✅ CI/CD can validate schema changes

Anti-Pattern (Code-First)

❌ WRONG: Writing TypeScript schema first

// DON'T DO THIS FIRST
export const users = pgTable('users', {
  id: uuid('id').primaryKey(),
  email: text('email').notNull(),
});

Sponsors

Details

Repository
github.com/bobmatnyc/claude-mpm-skills
Categories
Backend & APIs, Automation & Workflows, Databases
First seen
Apr 16, 2026

More from bobmatnyc/claude-mpm-skills

All 158
1vtex avatarvtex-io-auth-tokens-and-contextvtex/skillsApply when choosing which VTEX IO authentication token should back a request from a backend app. Covers `ctx.authToken`, `ctx.storeUserAuthToken`, `ctx.adminUse1.2Kskills.sh installs
2vtex avatarheadless-checkout-proxyvtex/skillsApply when implementing cart, checkout, or order placement logic proxied through a BFF for headless VTEX storefronts. Covers OrderForm lifecycle, cart creation,1.1Kskills.sh installs
3alchemyplatform avataragentic-gatewayalchemyplatform/skillsWire Alchemy into application code without an API key, using the x402 or MPP gateway with wallet-based auth (SIWE/SIWS) and per-request payments (USDC via x402,1.1Kskills.sh installs
4mindrally avatarprismamindrally/skillsExpert in Prisma ORM with type-safe database operations and schema design1.1Kskills.sh installs
5jezweb avatarcloudflare-apijezweb/claude-skillsHit the Cloudflare REST API directly for operations that wrangler and MCP can't handle well. Bulk DNS, custom hostnames, email routing, cache purge, WAF rules, 997skills.sh installs
6tencentcloudbase avatarrelational-database-mcp-cloudbasetencentcloudbase/skills[Deprecated] This is the required documentation for agents operating on the CloudBase Relational Database through MCP. It defines the canonical SQL management f960skills.sh installs