supabase-migration-deep-dive

Featured

Database migration patterns with Supabase CLI: npx supabase migration new, zero-downtime migrations, data backfill strategies, schema versioning, rollback strategies, and type generation. Use when creating database migrations, performing zero-downtime schema changes, backfilling data in production, managing schema versions, or planning rollback strategies. Trigger: "supabase migration", "supabase schema change", "supabase zero downtime", "supabase rollback", "supabase db push", "supabase migration new".

API & Backend 2,926 stars 433 forks Updated yesterday MIT

Install

View on GitHub

Quality Score: 99/100

Stars 20%
100
Recency 20%
100
Frontmatter 20%
70
Documentation 15%
100
Issue Health 10%
50
License 10%
100
Description 5%
100

Skill Content

# 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 Use the Supabase CLI to create, test, and apply migrations. Each migration is a timestamped SQL file that runs in order. **Create a new migration:** ```bash # Create a migration file with a descriptive name npx supabase migration new add_profiles_table # Creates: supabase/migrations/20260322120000_add_profiles_table.sql # List all m...

Details

Author
jeremylongshore
Repository
jeremylongshore/claude-code-plugins-plus-skills
Created
1 years ago
Last Updated
yesterday
Language
Python
License
MIT

Integrates with

Bundled in these plugins

Similar Skills

Semantically similar based on skill content — not just same category