database-migration
Supabase Datenbank-Migrationen erstellen
También disponible en: wshobson,Doyajin174,sickn33
Datenbank-Schemaänderungen sind fehleranfällig und können die Produktionsumgebung beeinträchtigen. Dieses Skill bietet bewährte Muster zum Erstellen idempotenter Supabase-Migrationen mit Workspace-Isolierung und Row Level Security Policies.
Descargar el ZIP de la skill
Subir en Claude
Ve a Configuración → Capacidades → Skills → Subir skill
Activa y empieza a usar
Pruébalo
Usando "database-migration". Create a migration for a 'project_tasks' table with name, status, due_date, and workspace_id. Include workspace isolation and RLS.
Resultado esperado:
- Tabelle erstellt mit workspace_id und ordnungsgemäßen Referenzen
- Index hinzugefügt auf workspace_id für Query-Performance
- RLS aktiviert mit user_organizations Join-Muster
- SELECT Policy erlaubt Benutzern das Anzeigen ihrer Workspace-Tasks
- System Policy ermöglicht Verwaltung über Service Role
- Migration ist idempotent mit IF NOT EXISTS Klauseln
Usando "database-migration". Add an ENUM type 'order_status' with values 'pending', 'processing', 'shipped', 'delivered', 'cancelled'
Resultado esperado:
- ENUM-Typ erstellt mit DO $$ Block-Muster
- Idempotente Erstellung behandelt bestehenden Typ problemlos
- Spalte zur orders-Tabelle mit neuem Typ hinzugefügt
Usando "database-migration". Create a function to calculate order total with items and tax
Resultado esperado:
- Funktion erstellt mit ordnungsgemäßer Parameterverwaltung
- Verwendet CREATE OR REPLACE für Idempotenz
- Beinhaltet ordnungsgemäße Fehlerbehandlung mit EXCEPTION Block
- Gibt berechnete Summe als Integer zurück
Auditoría de seguridad
SeguroThis is a documentation-only skill containing SQL migration patterns and guidelines. All static findings are false positives: the scanner misinterprets SQL syntax ($$ dollar quotes as backticks, gen_random_uuid as weak crypto, RLS mentions as crypto, BEGIN/END blocks as Windows SAM). No executable code, no file system access, no network calls, no command execution.
Factores de riesgo
🌐 Acceso a red (1)
📁 Acceso al sistema de archivos (1)
⚙️ Comandos externos (30)
Puntuación de calidad
Lo que puedes crear
Neue Tabellen sicher hinzufügen
Tabellen mit ordnungsgemäßer RLS, Indizes und Workspace-Isolierung in Supabase-Projekten erstellen
Automatisierung von Schemaänderungen
Konsistente Migrationsmuster für CI/CD-Deployment-Pipelines generieren
Multi-Tenant Datenbankdesign
Sichere Multi-Tenant-Isolierung mit durchgesetzter Row Level Security implementieren
Prueba estos prompts
Create a migration for a new table called 'project_tasks' with name, status, due_date, and workspace_id. Include workspace isolation and RLS.
Generate migration to add an ENUM type 'task_priority' with values 'low', 'medium', 'high', 'urgent' and a column using it.
Write a migration that adds an update_updated_at trigger to the 'users' table that sets updated_at on row changes.
Create a complete migration for a 'customer_orders' module with tables, foreign keys, indexes, enums, RLS policies for admins and customers, and a function to calculate order totals.
Mejores prácticas
- Immer schema-reference.md auf bestehende Tabellen prüfen, bevor neue erstellt werden
- IF NOT EXISTS und CREATE OR REPLACE verwenden, um Migrationen wiederholbar zu machen
- Immer workspace_id mit CASCADE Delete für Multi-Tenant-Tabellen hinzufügen
- RLS Policies mit sowohl Benutzerzugriff als auch System-Verwaltungsregeln einbinden
Evitar
- workspace_members Tabelle anstatt user_organizations Join-Muster verwenden
- Migrationen ohne idempotente IF NOT EXISTS Prüfungen erstellen
- Fehlende Indizes auf workspace_id verursachen Query-Performance-Probleme
- RLS nach ALTER TABLE zu aktivieren oder Policies zu erstellen vergessen