database-migration

Manage SQLModel/SQLAlchemy schema migrations with Alembic.

Updated Jan 19, 2026
One-click install
npx skills add https://github.com/codewithlaiba28/phase-two --skill database-migration-codewithlaiba28
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: database-migration
Source: https://github.com/codewithlaiba28/phase-two/tree/main/.claude/skills/database-migration
Command: npx skills add https://github.com/codewithlaiba28/phase-two --skill database-migration-codewithlaiba28

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires alembic, SQLModel, SQLAlchemy, and includes scripts (resource) and references (resource) components.

What problem does it solve?

This Skill streamlines the complex and error-prone process of evolving your database schema, ensuring data integrity and application stability during updates.

Core Features & Use Cases

  • Automated Schema Changes: Generates and applies database migrations based on model changes.
  • Version Control for Schema: Tracks database schema history, enabling rollbacks and audits.
  • Use Case: When you add a new completed_at field to your task model, this Skill will automatically create a migration script to add that column to your database table and apply it.

Quick Start

Use the database-migration skill to create a new migration script for recent model changes.

Frequently Asked Questions about database-migration

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

FAQPage Schema
How do I automate database schema migrations when my SQLModel definitions change?

Automating database schema migrations involves comparing your updated SQLModel definitions against the current database state and autogenerating migration scripts. This ensures your database schema evolves consistently without manual SQL writing.

What is the safest way to roll back a database schema change in SQLAlchemy?

Rolling back a database schema change safely requires a version control system that tracks migration history. By applying reverse migration scripts, you can revert specific schema modifications and restore the previous database state.

Does Alembic support autogenerating migration scripts from SQLModel?

Yes, Alembic supports autogenerating migration scripts from SQLModel definitions. It detects schema changes like new columns or tables and automatically creates the corresponding Python migration scripts to apply those updates.

How do I track database schema version history for auditing?

Tracking database schema version history is managed by applying sequential migration scripts that record each change. This creates an auditable log of schema evolution, enabling you to view, apply, or reverse specific database versions.

Can I use this approach to add a new column to an existing database table without data loss?

Yes, modifying an existing database table to add a column without data loss is achieved through autogenerating non-destructive migration scripts. The Skill applies the schema change while maintaining overall data integrity and application stability.