docs: rename test-account index to match users_v2 convention
Post-review fix for Task 1: code reviewer flagged that
idx_users_v2_is_test_account didn't match the idx_users_<suffix>
convention used by every other index in user_store.py. The
implementation commit (d163675) was amended to use
idx_users_test_account; this commit updates the plan and spec
docs so they stay in sync.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -71,7 +71,7 @@ END $$;
|
|||||||
Find the indexes block near line 338. After the existing `idx_users_banned` index (line ~344), add:
|
Find the indexes block near line 338. After the existing `idx_users_banned` index (line ~344), add:
|
||||||
|
|
||||||
```sql
|
```sql
|
||||||
CREATE INDEX IF NOT EXISTS idx_users_v2_is_test_account ON users_v2(is_test_account)
|
CREATE INDEX IF NOT EXISTS idx_users_test_account ON users_v2(is_test_account)
|
||||||
WHERE is_test_account = TRUE;
|
WHERE is_test_account = TRUE;
|
||||||
```
|
```
|
||||||
|
|
||||||
@@ -142,7 +142,7 @@ Connect to the dev database and confirm:
|
|||||||
psql -d golfgame -c "\d users_v2" | grep is_test_account
|
psql -d golfgame -c "\d users_v2" | grep is_test_account
|
||||||
psql -d golfgame -c "\d invite_codes" | grep marks_as_test
|
psql -d golfgame -c "\d invite_codes" | grep marks_as_test
|
||||||
psql -d golfgame -c "\d leaderboard_overall" | grep is_test_account
|
psql -d golfgame -c "\d leaderboard_overall" | grep is_test_account
|
||||||
psql -d golfgame -c "\di idx_users_v2_is_test_account"
|
psql -d golfgame -c "\di idx_users_test_account"
|
||||||
```
|
```
|
||||||
|
|
||||||
Expected: all four commands return matching rows.
|
Expected: all four commands return matching rows.
|
||||||
@@ -196,7 +196,7 @@ ssh root@129.212.150.189 << 'REMOTE'
|
|||||||
|
|
||||||
-- Partial index
|
-- Partial index
|
||||||
SELECT indexname, indexdef FROM pg_indexes
|
SELECT indexname, indexdef FROM pg_indexes
|
||||||
WHERE indexname = 'idx_users_v2_is_test_account';
|
WHERE indexname = 'idx_users_test_account';
|
||||||
SQL
|
SQL
|
||||||
REMOTE
|
REMOTE
|
||||||
```
|
```
|
||||||
@@ -205,7 +205,7 @@ Expected (all four present):
|
|||||||
- `users_v2.is_test_account` with default `false`
|
- `users_v2.is_test_account` with default `false`
|
||||||
- `invite_codes.marks_as_test` with default `false`
|
- `invite_codes.marks_as_test` with default `false`
|
||||||
- `leaderboard_overall` has an `is_test_account` column
|
- `leaderboard_overall` has an `is_test_account` column
|
||||||
- `idx_users_v2_is_test_account` exists
|
- `idx_users_test_account` exists
|
||||||
|
|
||||||
If any of these are missing, the server didn't actually restart (or restarted but the container has a stale image). Check `docker compose logs golfgame` for the line `User store schema initialized` — if it's not there, the migration never ran.
|
If any of these are missing, the server didn't actually restart (or restarted but the container has a stale image). Check `docker compose logs golfgame` for the line `User store schema initialized` — if it's not there, the migration never ran.
|
||||||
|
|
||||||
@@ -5383,7 +5383,7 @@ Run after the server-side changes (Tasks 1–7) ship to each environment.
|
|||||||
- [ ] `\d users_v2` on target DB shows `is_test_account` column with default `false`
|
- [ ] `\d users_v2` on target DB shows `is_test_account` column with default `false`
|
||||||
- [ ] `\d invite_codes` shows `marks_as_test` column with default `false`
|
- [ ] `\d invite_codes` shows `marks_as_test` column with default `false`
|
||||||
- [ ] `\d leaderboard_overall` shows `is_test_account` column
|
- [ ] `\d leaderboard_overall` shows `is_test_account` column
|
||||||
- [ ] `\di idx_users_v2_is_test_account` shows the partial index
|
- [ ] `\di idx_users_test_account` shows the partial index
|
||||||
- [ ] `SELECT count(*) FROM leaderboard_overall` returns nonzero (view re-populated after rebuild)
|
- [ ] `SELECT count(*) FROM leaderboard_overall` returns nonzero (view re-populated after rebuild)
|
||||||
- [ ] Default leaderboard query still works: `curl .../api/stats/leaderboard` returns entries
|
- [ ] Default leaderboard query still works: `curl .../api/stats/leaderboard` returns entries
|
||||||
- [ ] `?include_test=true` parameter is accepted (no 422/500)
|
- [ ] `?include_test=true` parameter is accepted (no 422/500)
|
||||||
|
|||||||
@@ -309,7 +309,7 @@ Two new columns + one partial index:
|
|||||||
|
|
||||||
```sql
|
```sql
|
||||||
ALTER TABLE users_v2 ADD COLUMN IF NOT EXISTS is_test_account BOOLEAN DEFAULT FALSE;
|
ALTER TABLE users_v2 ADD COLUMN IF NOT EXISTS is_test_account BOOLEAN DEFAULT FALSE;
|
||||||
CREATE INDEX IF NOT EXISTS idx_users_v2_is_test_account ON users_v2(is_test_account)
|
CREATE INDEX IF NOT EXISTS idx_users_test_account ON users_v2(is_test_account)
|
||||||
WHERE is_test_account = TRUE;
|
WHERE is_test_account = TRUE;
|
||||||
ALTER TABLE invite_codes ADD COLUMN IF NOT EXISTS marks_as_test BOOLEAN DEFAULT FALSE;
|
ALTER TABLE invite_codes ADD COLUMN IF NOT EXISTS marks_as_test BOOLEAN DEFAULT FALSE;
|
||||||
```
|
```
|
||||||
|
|||||||
Reference in New Issue
Block a user