Remove "Test Queens Player" duplicate rows from prod #419

Open
opened 2026-04-10 18:23:42 +00:00 by forgejo_admin · 0 comments

Type

Bug

Lineage

Standalone — discovered during 2026-04-10 Westside Ops Streamlit session while scanning for duplicate player rows. Low priority housekeeping.

Repo

forgejo_admin/basketball-api

What Broke

Two player rows exist in prod with name = 'Test Queens Player'. These are obvious leftover test data — no real player has that name. They inflate every player-count aggregate query by 2, and every "Queens" aggregate by 2. They showed up unnecessarily in today's jerseys query while investigating Marcus's player list.

Related: Test Kings Player (id 188) also exists but is not duplicated — leaving that one alone as it may be a deliberate test fixture used by the frontend for something. The duplicate is the only thing worth cleaning up right now.

Repro Steps

  1. Run: SELECT id, name FROM players WHERE name = 'Test Queens Player';
  2. Observe: 2 rows returned

Expected Behavior

Zero rows with name = 'Test Queens Player'. Test data should not live in prod. Any aggregate query counting players or counting Queens should exclude these artifacts.

Environment

  • Cluster/namespace: prod (basketball-api)
  • Service version/commit: current main
  • Affected tables: players, possibly parents, player_teams, orders, registrations via FK
  • Related alerts: none
  • Discovery: SELECT name, COUNT(*) FROM players GROUP BY name HAVING COUNT(*) > 1; returned Alice Uwamahoro (2) and Test Queens Player (2)

Acceptance Criteria

  • SELECT COUNT(*) FROM players WHERE name = 'Test Queens Player' returns 0
  • Associated parent rows (if orphaned after player delete) are also removed
  • Any player_teams, orders, registrations rows pointing to the deleted players are cleaned up first (no FK violations)
  • Deletion is done via a proper Alembic migration, not a direct SQL shell delete — audit trail matters
  • Migration is idempotent (safe to re-run)
  • No regression — Test Kings Player (id 188) is explicitly NOT touched
  • Real Queens player count drops by 2 in aggregate queries
  • westside-basketball — project this affects
### Type Bug ### Lineage Standalone — discovered during 2026-04-10 Westside Ops Streamlit session while scanning for duplicate player rows. Low priority housekeeping. ### Repo `forgejo_admin/basketball-api` ### What Broke Two player rows exist in prod with `name = 'Test Queens Player'`. These are obvious leftover test data — no real player has that name. They inflate every player-count aggregate query by 2, and every "Queens" aggregate by 2. They showed up unnecessarily in today's jerseys query while investigating Marcus's player list. Related: `Test Kings Player` (id 188) also exists but is not duplicated — leaving that one alone as it may be a deliberate test fixture used by the frontend for something. The duplicate is the only thing worth cleaning up right now. ### Repro Steps 1. Run: `SELECT id, name FROM players WHERE name = 'Test Queens Player';` 2. Observe: 2 rows returned ### Expected Behavior Zero rows with `name = 'Test Queens Player'`. Test data should not live in prod. Any aggregate query counting players or counting Queens should exclude these artifacts. ### Environment - Cluster/namespace: prod (basketball-api) - Service version/commit: current main - Affected tables: `players`, possibly `parents`, `player_teams`, `orders`, `registrations` via FK - Related alerts: none - Discovery: `SELECT name, COUNT(*) FROM players GROUP BY name HAVING COUNT(*) > 1;` returned Alice Uwamahoro (2) and Test Queens Player (2) ### Acceptance Criteria - [ ] `SELECT COUNT(*) FROM players WHERE name = 'Test Queens Player'` returns 0 - [ ] Associated parent rows (if orphaned after player delete) are also removed - [ ] Any `player_teams`, `orders`, `registrations` rows pointing to the deleted players are cleaned up first (no FK violations) - [ ] Deletion is done via a proper Alembic migration, not a direct SQL shell delete — audit trail matters - [ ] Migration is idempotent (safe to re-run) - [ ] No regression — `Test Kings Player` (id 188) is explicitly NOT touched - [ ] Real Queens player count drops by 2 in aggregate queries ### Related - `westside-basketball` — project this affects
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
forgejo_admin/basketball-api#419
No description provided.