Scaffold a new Supabase SQL migration file and regenerate TypeScript types. Use when creating database schema changes, adding tables, columns, or modifying RLS policies.
When the user invokes /create-migration, follow these steps:
Ask the user what database change they need (new table, add column, modify RLS policy, etc.) if not already specified.
Generate a timestamped SQL migration file:
supabase/migrations/<YYYYMMDDHHMMSS>_<descriptive_name>.sqlIF NOT EXISTS / IF EXISTS guards where appropriateAfter writing the migration SQL, remind the user to:
npx supabase db pushnpx supabase gen types typescript --project-id rgawlpqxqypntrknutlc > src/supabase/database.types.tsdatabase.types.ts together