Database Migration

Generate and validate Supabase migrations with RLS and auditing conventions.

Updated Aug 27, 2026
One-click install
npx skills add https://github.com/Tvshreyas/DISTILL --skill database-migration-tvshreyas
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: Database Migration
Source: https://github.com/Tvshreyas/DISTILL/tree/main/.agent/skills/db-migration
Command: npx skills add https://github.com/Tvshreyas/DISTILL --skill database-migration-tvshreyas

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Creates and validates Supabase migrations that adhere to Distill's schema conventions and security rules, reducing drift and risk during deployments.

Core Features & Use Cases

  • Generate migration files in supabase/migrations with the next sequential number after existing migrations.
  • Enforce RLS on new tables with auth.uid() based policies and include created_at, updated_at, and user_id FK constraints.
  • Provide local validation and safe push guidance to ensure migrations pass before deployment.

Quick Start

Run the migration generator to create the next migration file and push it to Supabase.

Frequently Asked Questions about Database Migration

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

FAQPage Schema
How do I automate Supabase migrations with RLS policies?

To automate Supabase migrations with RLS, generate sequential migration files enforcing auth.uid() policies, user_id foreign keys, and timestamp columns. This Skill validates schema conventions locally and provides safe push guidance to prevent deployment drift.

What are the required schema conventions for secure Supabase database migration?

Secure Supabase database migration requires enabling RLS with auth.uid() policies, adding a user_id foreign key to auth.users, implementing soft deletes, and including created_at and updated_at timestamp fields on every new table.

How do I create a new Supabase migration file that passes validation?

To create a Supabase migration file that passes validation, place it in the supabase/migrations directory with the next sequential number, including RLS statements, auditing fields, and user_id constraints to pass local schema checks before pushing.

Does this Supabase migration generator work for both development and production environments?

The Supabase migration generator works for both development and production environments by enforcing consistent schema conventions and security rules, providing local validation and safe push workflows to reduce deployment risk.

Why does my Supabase migration fail validation when adding new tables?

Supabase migration validation fails when new tables lack enabled RLS, auth.uid() policies, a user_id foreign key to auth.users, or mandatory created_at and updated_at timestamp fields. Enforcing these rules locally prevents deployment drift.