feat(11-03): cpvDivisions column — normalizer + backfill migration

Adds Tender.cpvDivisions String[] (@@index Gin) derived at ingestion time
via cpv-catalog.ts's divisionOf() — replaces exact-match cpvCodes
comparison with a typesafe, GIN-indexable hasSome target (FILTER-03,
Pitfall 2). Backfill migration 20260721150000_tender_cpv_divisions_backfill
applied locally: 1612/1671 rows populated across all observed divisions
(741 rows carry division '45' — Bauarbeiten); idempotent (second run:
UPDATE 0, ADD COLUMN IF NOT EXISTS / CREATE INDEX IF NOT EXISTS both skip
cleanly). Applied via docker exec psql + `prisma migrate resolve
--applied` + `prisma generate` against the local dev DB only — no
Docker deploy on the test server.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-07-21 16:11:40 +02:00
parent 7651ab6813
commit f9591dc491
6 changed files with 110 additions and 0 deletions
@@ -104,6 +104,7 @@ export class TenderIngestionService {
title: tender.title,
buyerName: tender.buyerName,
cpvCodes: tender.cpvCodes,
cpvDivisions: tender.cpvDivisions,
region: tender.region,
plz: tender.plz,
bundesland: tender.bundesland,
@@ -121,6 +122,7 @@ export class TenderIngestionService {
title: tender.title,
buyerName: tender.buyerName,
cpvCodes: tender.cpvCodes,
cpvDivisions: tender.cpvDivisions,
region: tender.region,
plz: tender.plz,
bundesland: tender.bundesland,