db-migrate

Generate Drizzle Kit migrations from schema.ts changes for TypeScript projects.

78|5|Updated Jan 6, 2026
One-click install
npx skills add https://github.com/getsentry/abacus --skill db-migrate-getsentry
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: db-migrate
Source: https://github.com/getsentry/abacus/tree/main/.claude/skills/db-migrate
Command: npx skills add https://github.com/getsentry/abacus --skill db-migrate-getsentry

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill centralizes and standardizes database migrations by leveraging Drizzle Kit to ensure that schema.ts and migration files remain in sync.

Core Features & Use Cases

  • Enforced Migration Generation: Always generate migrations with drizzle-kit generate to update drizzle/migrations, preventing hand-written SQL that can drift state.
  • Schema-Driven Workflow: Modify schema.ts first, then generate and review migrations to maintain a reliable history.
  • Review, Test, and Deploy: Integrates with CI/CD workflows to validate migrations before merging.

Quick Start

Update src/lib/schema.ts with your changes, run pnpm drizzle-kit generate, review the generated migration in drizzle/, and test locally before committing.

Frequently Asked Questions about db-migrate

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

FAQPage Schema
How do I generate database migrations with Drizzle Kit in TypeScript?

After modifying schema.ts, run pnpm drizzle-kit generate to automatically create migration files in the drizzle directory that stay in sync with your schema. Always test migrations locally before committing and opening a pull request.

What is the correct workflow for schema changes in a Drizzle Postgres project?

The correct workflow for schema changes in a Drizzle Postgres project is schema-driven: modify schema.ts first, generate migrations using drizzle-kit generate, review the generated files, test locally, and validate via CI/CD before merging.

Can I write custom SQL migrations instead of using drizzle-kit generate?

No, you cannot write custom SQL migrations. The workflow prohibits hand-written SQL migrations to prevent state drift, requiring you to always generate migrations with drizzle-kit generate to keep schema.ts and migration files synchronized.

How do I add or modify tables and indexes in a TypeScript project using Drizzle?

To add or modify tables, columns, or indexes in a TypeScript project using Drizzle, update the src/lib/schema.ts file with your changes and execute drizzle-kit generate to produce the corresponding migration files for review and deployment.

What's the best way to keep schema.ts and migration files in sync?

The best way to keep schema.ts and migration files in sync is to use Drizzle Kit's enforced migration generation, which standardizes the process by automatically generating migration files from your schema definitions rather than relying on manual SQL.

Do I need to test Drizzle migrations before submitting a pull request?

Yes, you need to test Drizzle migrations locally before submitting a pull request. The workflow enforces a review and testing process to validate generated migrations, integrating with CI/CD workflows to ensure reliability before merging.