db-migrations

Automate Drizzle database schema migrations with Bazel and idempotent SQL.

Updated Jul 5, 2026
One-click install
npx skills add https://github.com/xkl2013/lobe --skill db-migrations-xkl2013
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: db-migrations
Source: https://github.com/xkl2013/lobe/tree/main/.agents/skills/db-migrations
Command: npx skills add https://github.com/xkl2013/lobe --skill db-migrations-xkl2013

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes scripts (resource) components.

What problem does it solve?

This Skill streamlines the process of making schema changes, generating migrations, and handling rebase conflicts in Drizzle databases, ensuring idempotent SQL reviews and minimizing deployment risks.

Core Features & Use Cases

  • Schema Change Management: Handles changes to tables, columns, and indices with ease.
  • Migration Generation: Automatically generates migrations for schema updates.
  • Rebase Conflict Resolution: Manages rebase conflicts by keeping default branch migrations and discarding feature branch migrations.
  • Use Case: Use this Skill to efficiently manage your database schema changes in a feature branch, regenerate migrations from the rebased schema, and resolve rebase conflicts.

Quick Start

Run 'bun run db:generate' to generate migrations for your Drizzle database schema changes.

Frequently Asked Questions about db-migrations

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

FAQPage Schema
How do I generate Drizzle database migrations for schema changes?

Generate Drizzle database migrations by running 'bun run db:generate' to automatically create schema updates for modified tables, columns, and indices. This ensures idempotent SQL operations and minimizes deploy-time risk.

How do I resolve rebase conflicts in Drizzle database migration files?

Resolve Drizzle database migration rebase conflicts by keeping default branch migrations and discarding feature branch migrations, then regenerate migrations cleanly from the rebased schema to maintain history.

Does this database migration tool work with Bazel and Drizzle?

Yes, this database migration tool works with Bazel and Drizzle to automate schema change management. It uses Bazel to ensure idempotent SQL operations during migration generation, reducing deployment risks.

What is the best way to ensure idempotent SQL operations during database schema changes?

The best way to ensure idempotent SQL operations during database schema changes is to automate migration generation and management using Bazel with Drizzle. This minimizes deploy-time risk and guarantees consistent SQL reviews.

Why should I discard feature branch migrations when resolving database migration rebase conflicts?

You should discard feature branch migrations during rebase conflicts because default branch migrations represent stable schema history. This prevents conflicting schema changes and allows clean regeneration from the rebased schema.