Database Migration Manager

Generate, validate, and deploy Supabase PostgreSQL migrations with rollback workflows.

1|Updated May 5, 2025
One-click install
npx skills add https://github.com/jdeweedata/circletel --skill database-migration-manager
Or copy as Structured Prompt for Agentโ–ผ
Please help me install this Agent Skill.
Skill: Database Migration Manager
Source: https://github.com/jdeweedata/circletel/tree/main/.claude/skills/database-migration
Command: npx skills add https://github.com/jdeweedata/circletel --skill database-migration-manager

SYSTEM DOCUMENTATION & REQUIREMENTS

๐Ÿ’ก This Skill requires python>=3.8, and includes scripts (resource) components.

What problem does it solve?

CircleTel relies on database migrations to evolve its PostgreSQL schema safely across environments. Without a standardized workflow, migrations can be misordered, lack proper RLS scoping, and risk data integrity during deployments. This skill provides an opinionated, auditable process to generate, validate, and rollback migrations for Supabase projects.

Core Features & Use Cases

  • Migration generation and naming: create timestamped SQL files in supabase/migrations with a clear YYYYMMDDHHMMSS_description.sql convention.
  • Validation and safety checks: verify syntax, RLS enablement, indexes on foreign keys, and timestamp columns.
  • Rollback ready: scaffolds rollback migrations and supports local testing and staged deployments.
  • Local testing and deployment: enables testing via supabase db reset and migration up, with clear promotion to staging/production.

Quick Start

  • Create a new migration: python .claude/skills/database-migration/scripts/generate_migration.py "add new feature table"
  • Review and edit the generated file in supabase/migrations/ (the tool names the file with a timestamp)
  • Validate the migration: python .claude/skills/database-migration/scripts/validate_migration.py supabase/migrations/20251108120000_add_feature_table.sql
  • Apply locally: npx supabase db reset && npx supabase migration up
  • Push to staging: git add supabase/migrations/; git commit -m "feat: Add feature table migration"; git push origin feature/migration-name:staging

Frequently Asked Questions about Database Migration Manager

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

FAQPage Schema
How do I automate Supabase database migrations with rollback support?โ–ผ

Automate Supabase database migrations by using Python scripts to generate timestamped SQL files, validate RLS enablement and schema syntax, and scaffold rollback migrations for staged deployments.

What is the best way to manage RLS policy scaffolding in Supabase SQL migrations?โ–ผ

Manage RLS policy scaffolding in Supabase SQL migrations by generating timestamped files that enforce validation checks for RLS enablement, indexes on foreign keys, and timestamp columns before deployment.

How do I validate Supabase SQL migrations before pushing to staging or production?โ–ผ

Validate Supabase SQL migrations by running a validation script that verifies syntax correctness, RLS enablement, foreign key indexes, and timestamp columns to ensure safe deployment across environments.

Do I need Python to manage Supabase database migrations and schema changes?โ–ผ

Yes, you need Python 3.8 or higher to run the automation scripts that generate, validate, and deploy Supabase database migrations and rollback workflows.

Can I test Supabase database migrations locally before promoting to production?โ–ผ

Test Supabase database migrations locally by running supabase db reset and supabase migration up commands, then promote validated changes to staging and production environments via git.