supabase-migrations

Automate Supabase database migrations with RLS and multi-tenant patterns.

Updated Aug 29, 2023
One-click install
npx skills add https://github.com/SaschaLeh/dotfiles --skill supabase-migrations-saschaleh
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: supabase-migrations
Source: https://github.com/SaschaLeh/dotfiles/tree/main/dot_claude/skills/supabase-migrations
Command: npx skills add https://github.com/SaschaLeh/dotfiles --skill supabase-migrations-saschaleh

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Migrate Supabase databases safely and predictably by enforcing naming conventions, enabling RLS, and applying multi-tenant patterns across schemas.

Core Features & Use Cases

  • Structured file naming for all migrations
  • Enforced Row Level Security (RLS) and granular policies
  • Consistent multi-tenant isolation using tenant_id
  • Guidance for creating functions, policies, and safe changes

Quick Start

Create your first migration by placing a new SQL file under supabase/migrations using the prescribed timestamped naming format.

Frequently Asked Questions about supabase-migrations

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

FAQPage Schema
How do I enforce Row Level Security policies in Supabase database migrations?

To enforce Row Level Security in Supabase migrations, you apply structured migration templates that automatically enable RLS and define granular policies on PostgreSQL tables during schema creation. This ensures tables are secure by default.

What is the best way to structure multi-tenant database migrations in Supabase?

The best way to structure multi-tenant database migrations in Supabase is by enforcing consistent tenant_id isolation across schemas. This approach uses strict file naming conventions and standardized templates to apply tenant-level data separation securely.

How do I create secure PostgreSQL functions in a multi-tenant Supabase schema?

To create secure PostgreSQL functions in a multi-tenant Supabase schema, you use migration templates that implement security definer and invocation patterns. This ensures functions execute safely while respecting RLS policies and tenant_id isolation.

Does this Supabase migration workflow require manual naming of SQL files?

No, this Supabase migration workflow does not allow manual naming. It enforces a strict timestamped file naming convention placed under the supabase/migrations directory to ensure reproducible and ordered schema changes.

Can I apply schema changes to production-grade PostgreSQL without breaking multi-tenant isolation?

Yes, you can apply schema changes to production-grade PostgreSQL securely by using comprehensive migration templates. These templates enforce RLS, tenant_id isolation, and safe definer/invocation patterns to maintain multi-tenant integrity during updates.