docs: sync from backend f5e53cb — M24 DISTINCT ON, M30 blog indexes, M39 notification enums
This commit is contained in:
@@ -12,6 +12,16 @@ entries on top. Maintained by agents per the rule in `../AGENTS.md`.
|
||||
|
||||
---
|
||||
|
||||
### 2026-06-07 — backend@f5e53cb — DB audit medium batch M24/M30/M39
|
||||
|
||||
**Commits:** `f5e53cb`
|
||||
**Touched:** backend `src/db/repositories/drizzle/DrizzlePaymentRepo.ts`, `src/db/schema/blogPost.ts`, `src/db/schema/notification.ts`, `src/db/migrations/0021_needy_carlie_cooper.sql`, `package.json`, `package-lock.json`; docs `09 - Audits/DB Query & Schema Audit - 2026-06-06.md`, `09 - Audits/Activity Log.md`
|
||||
**Why:** Close Medium M24 by replacing in-memory deduplication with Postgres DISTINCT ON for payment latest-per-request lookups. Close Medium M30 by adding GIN index on blog_posts.tags and converting status to pgEnum. Close Medium M39 by converting notifications.type and notifications.category to pgEnum for DB-level type safety.
|
||||
**Verification:** backend `npm run typecheck` (clean), `npm test -- --runTestsByPath __tests__/db-audit-critical-fks.test.ts __tests__/drizzle-marketplace-repo-batch.test.ts --runInBand` (2 suites / 8 tests passed). Pushed to Forgejo.
|
||||
**Linked docs updated:** [[09 - Audits/DB Query & Schema Audit - 2026-06-06]]
|
||||
|
||||
---
|
||||
|
||||
### 2026-06-07 — backend@8fc2309 — DB audit M43/M44 missing FKs + H37 dispute enums
|
||||
|
||||
**Commits:** `8fc2309`
|
||||
|
||||
@@ -824,7 +824,7 @@ Lines 558-564 call `paymentRepo.list({ provider: 'shkeeper', direction: 'in', st
|
||||
|
||||
---
|
||||
|
||||
### 24. findByPurchaseRequestIdsAndStatuses latestPerRequest deduplication fetches all historical rows then filters in JS
|
||||
### 24. findByPurchaseRequestIdsAndStatuses latestPerRequest deduplication fetches all historical rows then filters in JS | **FIXED** `f5e53cb` v2.9.31
|
||||
|
||||
> **Category:** Unbounded Fetch | **File:** `src/db/repositories/drizzle/DrizzlePaymentRepo.ts:444-475`
|
||||
|
||||
@@ -884,7 +884,7 @@ Lines 222-231 fetch the buyer's 20 most recent requests (`limit: 20`) then call
|
||||
|
||||
---
|
||||
|
||||
### 30. blog_posts.tags GIN index and ILIKE search indexes missing
|
||||
### 30. blog_posts.tags GIN index and ILIKE search indexes missing | **FIXED** `f5e53cb` v2.9.31
|
||||
|
||||
> **Category:** Missing Index | **File:** `src/db/schema/blogPost.ts:49, 61-71`
|
||||
|
||||
@@ -974,7 +974,7 @@ The `reviews` table uses `seller_legacy_object_id text` and `reviewer_legacy_obj
|
||||
|
||||
---
|
||||
|
||||
### 39. notifications.type and notifications.category lack pgEnum — any string accepted by Postgres
|
||||
### 39. notifications.type and notifications.category lack pgEnum — any string accepted by Postgres | **FIXED** `f5e53cb` v2.9.31
|
||||
|
||||
> **Category:** Wrong Schema | **File:** `src/db/schema/notification.ts:24-25`
|
||||
|
||||
|
||||
Reference in New Issue
Block a user