database-migration

Automate Alembic database schema migrations with create, apply, and rollback.

187|45|Updated Mar 4, 2026
One-click install
npx skills add https://github.com/jeffstric/ZJT --skill database-migration-jeffstric
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: database-migration
Source: https://github.com/jeffstric/ZJT/tree/main/.claude/skills/database-migration
Command: npx skills add https://github.com/jeffstric/ZJT --skill database-migration-jeffstric

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

数据库迁移专家,负责指导和执行 Alembic 迁移脚本,并确保模型定义在 project/model 目录与数据库表结构保持同步。通过标准化迁移流程,降低手动变更风险。

Core Features & Use Cases

  • 规范化迁移脚本创建、对比模型与表的差异、以及历史版本回滚。
  • 同步 model/ 目录的模型定义与 alembic 版本中的数据库结构。
  • 提供清晰的迁移工作流与回滚保障,确保生产环境安全变更。

Quick Start

Create and apply an Alembic migration, then update the SQLAlchemy models to reflect the new schema.

Frequently Asked Questions about database-migration

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

FAQPage Schema
How do I automate SQLAlchemy database schema migrations using Alembic?

To automate database schema migrations using Alembic, you create, apply, and rollback migration scripts that synchronize SQLAlchemy models with database table structures. This enforces a consistent, SQL-safe workflow with rigorous versioning checks.

What is the best way to keep SQLAlchemy models synchronized with Alembic versions?

Keeping SQLAlchemy models synchronized with Alembic versions involves comparing model definitions in the model directory against alembic version scripts. This standardized migration process lowers manual change risks by ensuring structural alignment.

How do I rollback an Alembic migration to a previous database version?

Rolling back an Alembic migration to a previous database version utilizes built-in rollback capabilities within the migration workflow. This provides clear rollback assurance to ensure safe schema changes in production environments.

Can I alter existing table structures and create new tables with Alembic safely?

Altering existing table structures and creating new tables with Alembic is executed through a SQL-safe workflow. It performs rigorous checks during migration script creation to guarantee safe structural modifications.

Why does my Alembic migration workflow require rigorous versioning checks?

Alembic migration workflows require rigorous versioning checks to enforce a consistent process and guarantee that SQLAlchemy models align with database versions. This prevents data loss during structural alterations.