3. Regenerate Migrations Index
Purpose: Update the auto-generated migrations catalog after adding or modifying migration files. CI runs migrations:check which fails if the index is stale.
Prerequisites:
- Migration files exist in
supabase/migrations/
Cost / Duration: $0 | ~30 sec
Prompt
Regenerate the migrations index.
Step 1 — Regenerate the index:
```bash
bun run migrations:index
```
Scans all migration files, extracts headers, and writes
`supabase/migrations-index.md`.
Step 2 — Stage the updated index alongside the migration file:
```bash
git add supabase/migrations-index.md
```
Always commit the index alongside migration files.
Step 3 — Verify the index is current:
```bash
bun run migrations:check
```
Expected: Exit code 0 — "Migrations index is up to date."
Verification
-
bun run migrations:indexcompletes without errors -
bun run migrations:checkpasses (exit code 0) -
supabase/migrations-index.mdincludes the new migration entry
Related Prompts
- Create Migration — Create the migration file first
- Generate DB Types — Regenerate types if schema changed