database-migration-management

aj-geddes/useful-ai-prompts · updated Apr 8, 2026

$npx skills add https://github.com/aj-geddes/useful-ai-prompts --skill database-migration-management
0 commentsdiscussion
summary

Implement robust database migration systems with version control, rollback capabilities, and data transformation strategies. Includes migration frameworks and production deployment patterns.

skill.md

Database Migration Management

Table of Contents

Overview

Implement robust database migration systems with version control, rollback capabilities, and data transformation strategies. Includes migration frameworks and production deployment patterns.

When to Use

  • Schema versioning and evolution
  • Data transformations and cleanup
  • Adding/removing tables and columns
  • Index creation and optimization
  • Migration testing and validation
  • Rollback planning and execution
  • Multi-environment deployments

Quick Start

Minimal working example:

-- Create migrations tracking table
CREATE TABLE schema_migrations (
  version BIGINT PRIMARY KEY,
  name VARCHAR(255) NOT NULL,
  executed_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
  duration_ms INTEGER,
  checksum VARCHAR(64)
);

-- Create migration log table
CREATE TABLE migration_logs (
  id UUID PRIMARY KEY DEFAULT gen_random_uuid(),
  version BIGINT NOT NULL,
  status VARCHAR(20) NOT NULL,
  error_message TEXT,
  rolled_back_at TIMESTAMP,
  executed_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP
);

-- Function to record migration
CREATE OR REPLACE FUNCTION record_migration(
  p_version BIGINT,
  p_name VARCHAR,
  p_duration_ms INTEGER
) RETURNS void AS $$
// ... (see reference guides for full implementation)

Reference Guides

Detailed implementations in the references/ directory:

Guide Contents
Adding Columns Adding Columns
Renaming Columns Renaming Columns
Creating Indexes Non-blocking Creating Indexes Non-blocking
Data Transformations Data Transformations
Table Structure Changes Table Structure Changes

Best Practices

✅ DO

  • Follow established patterns and conventions
  • Write clean, maintainable code
  • Add appropriate documentation
  • Test thoroughly before deploying

❌ DON'T

  • Skip testing or validation
  • Ignore error handling
  • Hard-code configuration values

Discussion

Product Hunt–style comments (not star reviews)
  • No comments yet — start the thread.
general reviews

Ratings

4.643 reviews
  • Amelia Menon· Dec 20, 2024

    database-migration-management is among the better-maintained entries we tried; worth keeping pinned for repeat workflows.

  • Aanya Smith· Dec 12, 2024

    Useful defaults in database-migration-management — fewer surprises than typical one-off scripts, and it plays nicely with `npx skills` flows.

  • Charlotte Singh· Nov 15, 2024

    database-migration-management reduced setup friction for our internal harness; good balance of opinion and flexibility.

  • William Shah· Nov 11, 2024

    database-migration-management fits our agent workflows well — practical, well scoped, and easy to wire into existing repos.

  • Aanya Huang· Nov 3, 2024

    database-migration-management has been reliable in day-to-day use. Documentation quality is above average for community skills.

  • Aanya Harris· Oct 22, 2024

    Solid pick for teams standardizing on skills: database-migration-management is focused, and the summary matches what you get after install.

  • Henry Harris· Oct 6, 2024

    Registry listing for database-migration-management matched our evaluation — installs cleanly and behaves as described in the markdown.

  • Carlos Sanchez· Oct 2, 2024

    We added database-migration-management from the explainx registry; install was straightforward and the SKILL.md answered most questions upfront.

  • Henry Martin· Sep 25, 2024

    database-migration-management is among the better-maintained entries we tried; worth keeping pinned for repeat workflows.

  • Hiroshi Sanchez· Sep 17, 2024

    database-migration-management fits our agent workflows well — practical, well scoped, and easy to wire into existing repos.

showing 1-10 of 43

1 / 5