skills/smithery.ai/supabase-migration-deep-dive

supabase-migration-deep-dive

Installation
SKILL.md

Supabase Migration Deep Dive

Overview

Supabase migrations are SQL files managed by the CLI that track schema changes across environments. This skill covers the complete migration lifecycle: creating migrations with npx supabase migration new, writing zero-downtime schema changes that avoid table locks, backfilling data in batches, managing schema versioning across environments, planning rollback strategies, and regenerating TypeScript types after schema changes. Every pattern uses real Supabase CLI commands and createClient from @supabase/supabase-js.

When to use: Creating new database migrations, modifying production schemas without downtime, backfilling existing data after adding columns, managing migration history across dev/staging/production, rolling back failed migrations, or regenerating TypeScript types.

Prerequisites

  • Supabase CLI installed: npm install -g supabase or npx supabase --version
  • @supabase/supabase-js v2+ installed in your project
  • Local Supabase running: npx supabase start
  • Understanding of PostgreSQL DDL and transaction behavior

Instructions

Step 1: Create and Manage Migrations

Installs
1
First Seen
Apr 25, 2026