What problem does it solve?
This Skill simplifies and standardizes the creation of database migrations, preventing common errors that lead to inconsistent database states. It automates the adherence to critical steps like sequential numbering, proper naming, and mandatory updates to the 02_run_migrations.sql script, saving developers from complex debugging and data loss.
Core Features & Use Cases
- Mandatory Step Enforcement: Highlights and enforces critical steps for migration creation, especially updating the master run script.
- Idempotent SQL Patterns: Guides on writing migrations using
IF NOT EXISTS/IF EXISTS to ensure they are safe to run multiple times.
- Common Migration Patterns: Provides examples and templates for adding tables, columns, indexes, foreign keys, and enum types.
- Use Case: When you need to add a new column to a database table, this skill guides you through finding the next sequential number, creating the SQL file, updating the
02_run_migrations.sql script, and testing the migration, ensuring a smooth and error-free schema change.
Quick Start
I need to add a new email column to the politicians table. Guide me through the migration process, including all mandatory steps and best practices.