Skip to content

Fix fix-sherpa-clears for current schema and missing repair views - #61

Merged
owens1127 merged 1 commit into
mainfrom
fix/fix-sherpa-clears
Jun 15, 2026
Merged

Fix fix-sherpa-clears for current schema and missing repair views#61
owens1127 merged 1 commit into
mainfrom
fix/fix-sherpa-clears

Conversation

@owens1127

Copy link
Copy Markdown
Contributor

Summary

  • Repair fix-sherpa-clears after schema migration: use core.*, definitions.*, and cache.* qualified names
  • Create cache.firsts_clears_tmp, cache.noob_counts, and cache.p_stats_cache at runtime if missing (no migration required)
  • Fix p_stats_cache aggregation so activities without a fresh clear are not dropped and total time includes DNF rows
  • Update player_stats via inner join to cache (avoid zeroing rows) and add -stats-only flag

Test plan

  • Local docker postgres on :5433 with prod sample (3k recent instances)
  • Pre-run: 2,290 sherpa mismatches in sample
  • ./bin/fix-sherpa-clears completed in ~500ms
  • Post-run: 0 sherpa mismatches, 0 player_stats mismatches

Made with Cursor

The repair script was broken on prod because cache matviews no longer exist and SQL still referenced pre-migration table names. It now creates the views at runtime, uses schema-qualified tables, and avoids zeroing player_stats rows missing from cache.

Co-authored-by: Cursor <cursoragent@cursor.com>
@owens1127
owens1127 merged commit 5c85fd7 into main Jun 15, 2026
1 check passed
@owens1127
owens1127 deleted the fix/fix-sherpa-clears branch June 15, 2026 16:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant