Files
davila7__claude-code-templates/cli-tool/components/commands/database/supabase-migration-assistant.md
Dani 054c0e56e9 fix(commands): Remove deprecated 'model: sonnet' field from 142 command files
Removed the deprecated 'model: sonnet' field from command frontmatter to fix
compatibility issues with Claude Code. Commands will now inherit the model from
the active conversation instead of using a hardcoded deprecated model identifier.

Changes:
- Removed 'model: sonnet' from 142 command files across all categories
- Commands now use default model inheritance behavior
- Preserved 'model: claude-sonnet-4-5-20250929' in gemini-review.md (valid model)
- 67 commands without model field remain unchanged

This resolves the "model: sonnet not found" error reported in GitHub issues
and aligns with Claude Code's recommended practice of letting commands inherit
the conversation model.

Affected categories:
- Database/Supabase commands (8 files)
- Documentation commands (8 files)
- Deployment commands (11 files)
- Setup commands (14 files)
- Performance commands (8 files)
- Team commands (14 files)
- Security commands (6 files)
- NextJS/Vercel commands (10 files)
- Sync commands (14 files)
- And more across other categories

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-10-21 10:08:58 -04:00

2.2 KiB

allowed-tools: Read, Write, Edit, Bash argument-hint: [migration-type] | --create | --alter | --seed | --rollback description: Generate and manage Supabase database migrations with automated testing and validation

Supabase Migration Assistant

Generate and manage Supabase migrations with comprehensive testing and validation: $ARGUMENTS

Current Migration Context

  • Supabase project: MCP integration for migration management and validation
  • Migration files: !find . -name "*migrations*" -type d -o -name "*.sql" | head -5 existing migration structure
  • Schema version: Current database schema state and migration history
  • Local changes: !git diff --name-only | grep -E "\\.sql$|\\.ts$" | head -3 pending database modifications

Task

Execute comprehensive migration management with automated validation and testing:

Migration Type: Use $ARGUMENTS to specify table creation, schema alterations, data seeding, or migration rollback

Migration Management Framework:

  1. Migration Planning - Analyze schema requirements, design migration strategy, identify dependencies, plan rollback procedures
  2. Code Generation - Generate migration SQL files, create TypeScript types, implement safety checks, optimize execution order
  3. Validation Testing - Test migration on development data, validate schema changes, verify data integrity, check constraint violations
  4. Supabase Integration - Apply migrations via MCP server, monitor execution status, handle error conditions, validate final state
  5. Type Generation - Generate TypeScript types, update application interfaces, sync with client-side schemas, maintain type safety
  6. Rollback Strategy - Create rollback migrations, test rollback procedures, implement data preservation, validate recovery process

Advanced Features: Automated type generation, migration testing, performance impact analysis, team collaboration, CI/CD integration.

Safety Measures: Pre-migration backups, dry-run validation, rollback testing, data integrity checks, performance monitoring.

Output: Complete migration suite with SQL files, TypeScript types, test validation, rollback procedures, and deployment documentation.