Use when needing a fresh local database, after schema changes, or before testing queue and reflow logic
Reset the local D1 database, apply all migrations, and load the bundled program data.
wrangler dev if running:
lsof -ti:8787 | xargs kill 2>/dev/null || true
rm -rf .wrangler/state
npx wrangler d1 migrations apply hevy-planner-db --local
npx wrangler d1 execute hevy-planner-db --local --file=seed/seed.sql
npx wrangler d1 execute hevy-planner-db --local --command="SELECT 'queue_items' as tbl, count(*) as n FROM queue_items UNION ALL SELECT 'users', count(*) FROM users;"
seed/seed.sql doesn't exist yet, generate seed SQL from the program JSON using the domain logic.migrations/. Files are applied in filename-sorted order.