supabase-database-migration

Generate timestamped SQL migrations from Drizzle schemas and apply them to Supabase.

Updated Aug 27, 2026
One-click install
npx skills add https://github.com/curiousanthony/supabase-sveltekit --skill supabase-database-migration
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: supabase-database-migration
Source: https://github.com/curiousanthony/supabase-sveltekit/tree/main/.cursor/skills/supabase-database-migration
Command: npx skills add https://github.com/curiousanthony/supabase-sveltekit --skill supabase-database-migration

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes scripts (resource) and references (resource) components.

What problem does it solve?

This Skill ensures your Supabase database schema, Drizzle ORM definitions, and local development environment remain synchronized using a robust schema-first workflow, preventing drift and deployment issues.

Core Features & Use Cases

  • Schema Synchronization: Automatically generates SQL migrations from Drizzle schema definitions.
  • Local Database Management: Provides commands to apply new migrations or reset the local database to a clean state.
  • Deployment Workflow: Guides the process of pushing schema changes to remote Supabase projects.
  • Use Case: When adding a new 'users' table with columns for 'id', 'email', and 'created_at', this skill will generate the necessary SQL migration, allow you to test it locally, and then deploy it to your production Supabase instance.

Quick Start

Use the supabase-database-migration skill to generate a new migration file from your Drizzle schema changes.

Frequently Asked Questions about supabase-database-migration

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

FAQPage Schema
How do I manage Supabase database schema changes using Drizzle ORM?

You can manage Supabase database schema changes by editing Drizzle ORM schema definitions in code, using drizzle-kit to generate timestamped SQL migrations, and applying them locally or to remote environments.

What is the best way to generate SQL migrations from a Drizzle schema for Supabase?

Generating SQL migrations from a Drizzle schema involves using the drizzle-kit db:generate command to automatically create timestamped SQL migration files based on your code definitions.

How do I apply local database migrations in a Supabase workflow?

To apply local database migrations in a Supabase workflow, you use the `supabase migration up` command to apply new changes or `supabase db reset` to reset the local database to a clean state.

How can I deploy Drizzle schema changes to a remote Supabase project?

Deploying Drizzle schema changes to a remote Supabase project is done using the `supabase db push` command after testing the generated SQL migrations locally.

Why does my local Supabase database have schema drift with my Drizzle ORM definitions?

Schema drift occurs when code, migrations, and local databases fall out of sync; enforcing a schema-first workflow prevents this by ensuring Drizzle definitions generate matching SQL migrations.

Can I use drizzle-kit to reset my local Supabase database during development?

While drizzle-kit generates the schema migrations, resetting the local Supabase database is handled by the `supabase db reset` command to ensure a clean state for testing.