drizzle-schema-changes

Coordinate Drizzle schema, Zod validators, and form updates with drizzle-kit migrations.

Updated Aug 27, 2026
One-click install
npx skills add https://github.com/Vonshlovens/vonshlovens --skill drizzle-schema-changes
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: drizzle-schema-changes
Source: https://github.com/Vonshlovens/vonshlovens/tree/main/.claude/skills/drizzle-schema-changes
Command: npx skills add https://github.com/Vonshlovens/vonshlovens --skill drizzle-schema-changes

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

When adding a column to a Drizzle schema, developers risk forgetting to update all dependent layers (DB schema, API input validation, and client-side forms). Mismatches can cause soft failures where data is rejected or silently dropped due to Zod stripping unknown fields.

Core Features & Use Cases

  • Ensures consistent updates across src/lib/db/schema/, API Zod schemas (CreateXSchema/UpdateXSchema), and client-side form schemas.
  • Provides a safe migration workflow with drizzle-kit commands to generate, apply, and manage migrations.
  • Guides developers to avoid common pitfalls that lead to silent data loss and deployment issues.

Quick Start

Edit the Drizzle schema files in src/lib/db/schema/ and run drizzle-kit generate followed by drizzle-kit migrate to apply migrations.

Frequently Asked Questions about drizzle-schema-changes

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

FAQPage Schema
Why does adding a column in Drizzle ORM cause silent data loss?

Silent data loss occurs when Drizzle schema columns are added without updating dependent Zod validators. Zod schemas strip unknown fields, causing API inputs to drop the new data before it reaches the database.

How do I safely generate and apply migrations using drizzle-kit?

To safely generate and apply migrations, edit your Drizzle schema files first, then run the drizzle-kit generate command, followed immediately by drizzle-kit migrate to apply the schema changes to your database.

What is the correct workflow for updating Drizzle schema and Zod validators?

The correct workflow for updating Drizzle schema and Zod validators requires同步 updating src/lib/db/schema/, API input validators like CreateXSchema, and client-side form schemas to prevent mismatches and soft failures.

Does drizzle-kit migration order affect schema validation and data persistence?

Yes, drizzle-kit migration order directly affects data persistence. Invoking generate, migrate, and studio commands in the proper order enforces safe schema changes and prevents deployment issues caused by mismatched validation layers.

Do I need to update client-side form schemas when modifying Drizzle database columns?

Yes, you need to update client-side form schemas when modifying Drizzle database columns. Synchronizing server-side Zod schemas and client forms ensures data is accepted and prevents soft failures where submissions are rejected.