migrate
Streamline your database migration process with a structured workflow.
Create a new database migration for: $ARGUMENTS
Follow this workflow:
- Check existing schema — read the latest migrations and ORM schema to understand current state
- Create the migration file — use your migration tool (Supabase CLI, Drizzle Kit, Prisma, etc.)
- Write the SQL — make it idempotent when possible (IF NOT EXISTS, IF EXISTS)
- Update ORM schema — update your TypeScript schema to match the migration
- Test locally — run migration locally to verify (if local dev is set up)
- Show for review — display the migration SQL for review before applying to production
IMPORTANT: Always enable Row Level Security (RLS) on new tables if using Supabase/Postgres. IMPORTANT: Always add indexes on foreign key columns. IMPORTANT: Never modify an existing committed migration file — create a new one. IMPORTANT: Keep migrations small and focused — one concern per migration.