database-migrations

Manage database schema evolution with Alembic for Python applications.

25|11|Updated Feb 6, 2025
One-click install
npx skills add https://github.com/METR/inspect-action --skill database-migrations-metr
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: database-migrations
Source: https://github.com/METR/inspect-action/tree/main/.claude/skills/db-migrations
Command: npx skills add https://github.com/METR/inspect-action --skill database-migrations-metr

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes scripts (resource) and references (resource) components.

What problem does it solve?

This Skill streamlines the process of creating, applying, and recovering from database schema changes, ensuring consistency across development and production environments.

Core Features & Use Cases

  • Automated Migration Generation: Creates new database migration scripts based on model changes.
  • Apply Migrations: Applies pending schema changes to databases in various environments.
  • Schema Drift Recovery: Provides methods to detect and fix inconsistencies between the database schema and application models.
  • Use Case: When you update your application's data models, use this Skill to automatically generate the necessary SQL to update the database schema, then apply those changes to your staging environment.

Quick Start

Use the database-migrations skill to apply all pending migrations to the production database.

Frequently Asked Questions about database-migrations

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

FAQPage Schema
How do I generate Alembic migrations from schema model changes?

To apply pending database migrations, this Skill executes schema changes against target databases, ensuring consistency across development and production environments. It supports deterministic execution for CI/CD pipelines and operational database management tasks.

What is the best way to recover from database schema drift in Python?

Schema drift recovery detects and fixes inconsistencies between the database schema and application models. This Skill provides dedicated methods to identify drift and apply corrective migrations to realign the production database state with expected application requirements.

Can I rollback database schema changes applied through Alembic?

Yes, this Skill handles the rollback of applied database migrations. It provides operational management to revert schema changes, allowing you to undo migration scripts and restore the database to a previous state when needed.

Does this database migration approach support deterministic execution for CI/CD pipelines?

Yes, this Skill supports deterministic task execution specifically for CI/CD pipelines. It manages schema evolution by applying database migrations in a predictable manner, ensuring deployment consistency across different operational environments.