Files
nuzlocke-tracker/.beans/archive/nuzlocke-tracker-ecn3--prune-stale-seed-data-during-seeding.md
Julian Tabel c9d42b091f
All checks were successful
CI / backend-tests (push) Successful in 26s
CI / frontend-tests (push) Successful in 29s
Daedalus and Talos integration test
2026-03-20 16:31:19 +01:00

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:

  1. 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.
  2. Encounters: After upserting encounters for a route+game, delete encounters not in the seed data for that route+game pair.
  3. Bosses: After upserting bosses for a version group, delete bosses with order values beyond what the seed provides.