database-migration

Standardize database schema migrations with rollback scripts and validation checks.

Updated Dec 29, 2025
One-click install
npx skills add https://github.com/dseirz-rgb/worker --skill database-migration-dseirz-rgb
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: database-migration
Source: https://github.com/dseirz-rgb/worker/tree/main/.kiro/skills/database-migration
Command: npx skills add https://github.com/dseirz-rgb/worker --skill database-migration-dseirz-rgb

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

数据库迁移操作风险高、缺乏标准化流程,可能导致生产中断。此技能提供一个安全、可审计的迁移工作流,确保变更经过备份、测试、验证后再落地,并包含清晰的回滚策略。

Core Features & Use Cases

  • 安全工作流:备份、本地测试、预发布验证、生产执行和回滚准备。
  • 回滚与验证:为每次迁移提供回滚脚本模板、数据校验和日志记录。
  • 最佳实践模板:包括 Drizzle ORM 迁移模板、字段变更模板等,用于实际项目的迁移编写。 现实用例: 需要在 users 表上添加新字段或修改索引时,按照该技能的流程完成端到端迁移。

Quick Start

Follow these steps to initialize a migration workflow in your project. Install drizzle-kit, configure drizzle.config.ts, generate migrations, run tests locally, and prepare a backup before applying on production.

Frequently Asked Questions about database-migration

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

FAQPage Schema
How do I safely manage database schema changes in production?

To safely manage database schema changes, you should standardize migrations by enforcing local testing, backups, staged deployment, and explicit rollback scripts before applying any modifications to production.

What is the best way to add a new field to a PostgreSQL table using drizzle-kit?

The best way to add a new field to a PostgreSQL table is to use a standardized drizzle-kit migration template that includes schema generation, local testing, backup preparation, and a defined rollback procedure.

Why do I need an explicit rollback script for database migrations?

You need an explicit rollback script for database migrations because it provides a verified, auditable recovery path to immediately restore the database schema if a deployment causes unexpected production failures.

Does this database migration workflow support relational databases other than PostgreSQL?

Yes, this database migration workflow supports typical relational databases by standardizing schema change procedures, risk assessments, and validation checks across different relational environments.

What are the limitations of relying only on drizzle-kit for schema migrations?

Relying only on drizzle-kit for schema migrations lacks enforced safety checks; without standardized backup creation, staged deployment, and explicit rollback scripts, you risk production downtime during failed changes.

When do I need a standardized database migration workflow?

You need a standardized database migration workflow when your team performs high-risk schema changes that require strict auditing, data validation, and reliable rollback procedures to prevent production interruptions.