Add --prune flag to seed command to remove stale data

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>
This commit is contained in:
2026-02-21 17:33:54 +01:00
parent d535433583
commit efa0b5f855
4 changed files with 109 additions and 8 deletions

View File

@@ -2,6 +2,7 @@
Usage:
python -m app.seeds # Run seed
python -m app.seeds --prune # Run seed and remove stale data not in seed files
python -m app.seeds --verify # Run seed + verification
python -m app.seeds --export # Export all seed data from DB to JSON files
"""
@@ -21,7 +22,8 @@ async def main():
await export_all()
return
await seed()
prune = "--prune" in sys.argv
await seed(prune=prune)
if "--verify" in sys.argv:
await verify()