Without --prune, seeds continue to only upsert (add/update). With --prune, routes, encounters, and bosses not present in the seed JSON files are deleted from the database. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
869 B
869 B
title, status, type, priority, created_at, updated_at
| title | status | type | priority | created_at | updated_at |
|---|---|---|---|---|---|
| Prune stale seed data during seeding | completed | bug | normal | 2026-02-21T16:28:37Z | 2026-02-21T16:29:43Z |
Seeds only upsert (add/update), they never remove routes, encounters, or bosses that no longer exist in the seed JSON. When routes are renamed, old route names persist in production.
Fix
After upserting each entity type, delete rows not present in the seed data:
- Routes: After upserting all routes for a version group, delete routes whose names are not in the seed set. FK cascades handle child routes and encounters.
- Encounters: After upserting encounters for a route+game, delete encounters not in the seed data for that route+game pair.
- Bosses: After upserting bosses for a version group, delete bosses with order values beyond what the seed provides.