database-migrations

Automate SQL-based database migrations with strict naming and rollback conventions.

1|Updated Mar 19, 2026
One-click install
npx skills add https://github.com/wildbitca/ai-resources --skill database-migrations-wildbitca
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: database-migrations
Source: https://github.com/wildbitca/ai-resources/tree/main/skills/database-migrations
Command: npx skills add https://github.com/wildbitca/ai-resources --skill database-migrations-wildbitca

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

It ensures database schema changes are tracked, reviewed, and applied in a safe, repeatable way using a formal migration system.

Core Features & Use Cases

  • Enforces migration through a centralized system (e.g., Supabase CLI) with migrations stored in supabase/migrations/.
  • Defines strict file-naming conventions to maintain coherent history and enable proper sequencing.
  • Supports idempotent operations and safe rollback guidelines for production environments.
  • Use as a standard protocol when adding or modifying tables, indexes, or policies to prevent drift between code and schema.

Quick Start

Create a new timestamped migration file and push it through the migration workflow to apply the change safely.

Frequently Asked Questions about database-migrations

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

FAQPage Schema
How do I prevent database schema drift when applying SQL migrations across staging and production?

Database schema drift is prevented by standardizing SQL migrations through a centralized system like Supabase CLI, enforcing strict file-naming conventions, idempotent operations, and a formal review process to ensure changes are tracked and reproducible across all environments.

What is the best way to structure idempotent database migrations for safe rollback?

The best way to structure idempotent database migrations is to use strict timestamped file-naming conventions and store them in a centralized directory like supabase/migrations/, ensuring every schema alteration includes a documented, tested rollback approach for safe production execution.

How do I create and apply a new SQL migration using the Supabase CLI workflow?

To apply a new SQL migration, create a timestamped migration file within the supabase/migrations/ directory and push it through the standardized migration workflow, ensuring the schema change is reviewed, tested, and safely applied to your database.

Can I use this database migration workflow for altering existing tables and policies?

Yes, this database migration workflow supports creating, altering, and rolling back schemas, making it suitable for safely modifying existing tables, indexes, and policies while preventing risky changes and maintaining a coherent migration history.

Why do my database migrations fail to sequence correctly during deployment?

Database migrations fail to sequence correctly when strict file-naming conventions are not enforced, which is why standardizing migration files in a centralized system ensures proper sequencing and prevents deployment failures.

When should I not use automated database migrations for schema changes?

Automated database migrations should not be used without a documented rollback approach for production environments, as applying non-idempotent operations or bypassing the standardized review process introduces risky schema changes and potential drift.