Safeguards database schema changes with idempotent patterns and PostgreSQL best practices to prevent migration failures and data loss.
Migration Safety is a specialized Claude Code skill designed for developers working with Supabase and PostgreSQL. It enforces high-integrity database evolution by implementing defensive coding patterns such as idempotent IF NOT EXISTS clauses, proper Row-Level Security (RLS) configuration, and transactional rollback handling. By applying learned lessons from real-world production incidents, this skill helps Claude write, review, and debug migrations that are resilient to failures, ensuring that data types, constraints, and security policies are applied correctly and consistently across all environments.
主な機能
01Validates function immutability for partial indexes to prevent PostgreSQL errors
02Implements idempotent IF NOT EXISTS patterns for tables, columns, and indexes
03Automates Row-Level Security (RLS) setup including policies and grants
04Manages dual-name constraint dropping to handle PostgreSQL default naming conventions
050 GitHub stars
06Ensures seed data integrity with foreign key existence guards
ユースケース
01Writing new Supabase migrations with complex table relationships and security policies
02Standardizing data types like BIGINT vs NUMERIC for high-precision financial data
03Debugging and fixing migrations that failed or partially rolled back in production