Database Migration Skill - Supabase PostgreSQL

Create Supabase PostgreSQL migration templates for tables, indexes, triggers, and RLS policies.

Updated Sep 2, 2025
One-click install
npx skills add https://github.com/Mintenance-LTD/mintenance --skill database-migration-skill-supabase-postgresql
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: Database Migration Skill - Supabase PostgreSQL
Source: https://github.com/Mintenance-LTD/mintenance/tree/main/.claude/skills/database-migrations
Command: npx skills add https://github.com/Mintenance-LTD/mintenance --skill database-migration-skill-supabase-postgresql

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

This Skill provides expert guidance and reusable patterns for managing Supabase PostgreSQL database migrations, ensuring data integrity, security, and efficient schema evolution.

Core Features & Use Cases

  • Migration Templates: Standardized SQL templates for creating tables, indexes, triggers, and RLS policies.
  • RLS Policy Patterns: Pre-built Row Level Security policies for common access control scenarios (user-owned, role-based, related resources).
  • Indexing Strategies: Guidance on optimizing query performance through effective indexing.
  • Use Case: When adding a new feature that requires a new table, use the provided template to create the table, define necessary indexes, and implement robust RLS policies to secure the data from the outset.

Quick Start

Use the database migration skill to create a new table for user profiles with standard timestamps and RLS policies.

Frequently Asked Questions about Database Migration Skill - Supabase PostgreSQL

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

FAQPage Schema
How do I write a Supabase PostgreSQL migration to add a new table with RLS?

A Supabase PostgreSQL migration uses standardized SQL templates to create tables, define indexes, and implement Row Level Security policies. This ensures data integrity, efficient schema evolution, and robust access control from the outset.

What are the best practices for implementing Row Level Security policies in Supabase?

Row Level Security best practices involve using pre-built RLS policy patterns for common access control scenarios like user-owned data, role-based access, and related resources. Applying these patterns during table creation secures your PostgreSQL database immediately.

How do I create a junction table and add enum types in a PostgreSQL migration?

Creating junction tables and adding enum types are common migration scenarios supported by standardized SQL templates. You execute these schema changes using command-line tools like Supabase CLI or psql to evolve your database structure efficiently.

Does this database migration approach support soft deletes and triggers in PostgreSQL?

Yes, the database migration patterns include implementing soft deletes and creating database triggers. These SQL templates provide comprehensive guidance for schema evolution while maintaining data integrity within your Supabase PostgreSQL environment.

Can I use Supabase CLI and psql to apply PostgreSQL schema migrations?

Yes, you can apply PostgreSQL schema migrations using command-line examples provided for both Supabase CLI and psql. These tools execute the SQL templates required for table creation, indexing, and RLS policy implementation.