db-migration

Manage Supabase database schema migrations with analysis, planning, execution, and verification.

1|Updated Nov 12, 2024
One-click install
npx skills add https://github.com/ak125/nestjs-remix-monorepo --skill db-migration-ak125
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: db-migration
Source: https://github.com/ak125/nestjs-remix-monorepo/tree/main/.claude/skills/db-migration
Command: npx skills add https://github.com/ak125/nestjs-remix-monorepo --skill db-migration-ak125

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

This Skill provides a structured and safe approach to managing database schema changes in Supabase, minimizing the risk of data loss or application downtime.

Core Features & Use Cases

  • Guided DDL Operations: Ensures safe execution of CREATE, ALTER, and DROP statements.
  • RLS Auditing: Verifies Row Level Security policies are correctly implemented and maintained.
  • Schema Validation: Checks for index integrity, constraint adherence, and overall schema health.
  • Use Case: When adding a new column to a critical table, this Skill guides you through the analysis, planning, execution, and verification phases, including rollback strategies and backfilling for large tables.

Quick Start

Use the db-migration skill to create new tables for the 'products' module.

Frequently Asked Questions about db-migration

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

FAQPage Schema
How do I safely execute Supabase schema migrations on large tables?

Safely execute Supabase schema migrations by using a four-phase workflow: analysis, planning, execution, and verification. This structured approach includes backfill strategies for large tables to minimize downtime and prevent data loss.

What is the best way to manage DDL operations in Supabase without breaking RLS policies?

Managing DDL operations in Supabase without breaking RLS policies requires RLS auditing patterns during schema validation. This verifies that Row Level Security policies are correctly implemented and maintained after structural changes.

Can I rollback ALTER TABLE statements if a database migration fails?

You can rollback ALTER TABLE statements if a database migration fails by using provided rollback templates. These templates are integrated into the planning phase to ensure safe DDL operations and immediate schema recovery.

How does schema validation work after applying Supabase database migrations?

Schema validation after applying Supabase database migrations works by running data validation queries to check for index integrity and constraint adherence. This verification phase ensures overall schema health and structural correctness.

Do I need a specific workflow to add a new column to a critical Supabase table?

You need a specific workflow to add a new column to a critical Supabase table. The process guides you through analysis, planning, execution, and verification phases, ensuring safe execution with necessary rollback and backfill strategies.