home / skills / pluginagentmarketplace / custom-plugin-sql / migrations

migrations skill

/skills/migrations

This skill helps you manage database schema changes safely with version control, migration tools, and zero-downtime deployment strategies.

npx playbooks add skill pluginagentmarketplace/custom-plugin-sql --skill migrations

Review the files below or copy the command above to add this skill to your agents.

Files (6)
SKILL.md
995 B
---
name: migrations
description: Database schema migrations and version control
sasmp_version: "1.3.0"
bonded_agent: 08-sql-devops
bond_type: PRIMARY_BOND
---

# Database Migrations Skill

## Overview
Manage database schema changes with version control, migration tools, and safe deployment practices.

## Topics Covered

### Migration Tools
- Flyway
- Liquibase
- Alembic (Python)
- Prisma migrations
- TypeORM migrations

### Migration Patterns
- Incremental changes
- Reversible migrations
- Data migrations
- Zero-downtime migrations
- Blue-green deployments

### Version Control
- Migration versioning
- Baseline management
- Migration history
- Conflict resolution
- Team workflows

### Best Practices
- Small, focused changes
- Testing migrations
- Rollback strategies
- Documentation
- CI/CD integration

## Prerequisites
- SQL fundamentals
- Version control basics

## Learning Outcomes
- Create safe migrations
- Use migration tools
- Deploy without downtime
- Manage schema versions

Overview

This skill teaches practical database schema migrations and version control for safe, repeatable schema evolution. It combines migration tools, patterns, and deployment strategies to minimize downtime and data loss. You will learn tool-specific workflows and general practices to manage migrations across teams and environments.

How this skill works

The skill inspects migration workflows and tooling choices, showing how to author, version, and apply schema changes in a controlled manner. It covers both DDL and data migrations, reversible steps, and strategies for zero-downtime deployment such as blue-green and rolling updates. Guidance includes integrating migrations into CI/CD pipelines and resolving version conflicts in team settings.

When to use it

  • When introducing schema changes across multiple environments (dev, staging, prod).
  • When adopting or standardizing a migration tool (Alembic, Flyway, Liquibase, Prisma, TypeORM).
  • When planning zero-downtime or large data migrations for production systems.
  • When establishing team workflows and migration versioning practices.
  • When adding automated migration checks to CI/CD pipelines.

Best practices

  • Make small, focused migrations that are easy to review and revert.
  • Write reversible migrations and include explicit rollback paths when possible.
  • Test migrations on staging with representative data before production rollout.
  • Version-control migration files and maintain a clear migration history and baseline.
  • Integrate migrations into CI/CD to run checks and prevent conflicting versions.

Example use cases

  • Converting a table column type safely with a phased, zero-downtime migration.
  • Applying incremental schema updates from feature branches via CI-driven migrations.
  • Performing a large data backfill using background jobs and reversible migration steps.
  • Standardizing team workflows by adopting Alembic for Python projects and documenting conventions.
  • Resolving migration conflicts after parallel development by rebasing and baselining.

FAQ

Which migration tool should I pick for a Python project?

Use Alembic for SQLAlchemy-native projects; choose Flyway or Liquibase if you need language-agnostic, enterprise-grade features. Evaluate team skillset and CI/CD integration needs.

How can I avoid downtime when changing large tables?

Use phased changes: add new columns, backfill data asynchronously, switch reads/writes, and then drop old structures. Blue-green or rolling deployments help coordinate schema and application updates.