fix(cms): Home usps/items key is its own field, not the row primary key (MITHOME-138)
CI Pipeline with Test Management / 🧪 Run Tests & Generate Reports (push) Canceled after 0s
Test Reporting & Gherkin Analysis / 🧪 Run Tests & Generate Reports (push) Canceled after 0s
CI Pipeline with Test Management / 🐳 Docker Integration Tests (push) Canceled after 0s
CI Pipeline with Test Management / 🏗️ Build Docker Image (push) Canceled after 0s
CI Pipeline with Test Management / 📊 Generate Test Summary (push) Canceled after 0s
Test Reporting & Gherkin Analysis / 📊 Analyze Test Coverage (push) Canceled after 0s
Test Reporting & Gherkin Analysis / 🔄 Sync with Linear (push) Canceled after 0s
Test Reporting & Gherkin Analysis / ⚡ Performance Monitoring (push) Canceled after 0s

The editable id of the Home usps/items rows was also the row's primary key in
PostgreSQL (a duplicate would fail to save; new rows needed a manual id). It
is now the `key` field; migration 20260929_213538_home_row_keys adds the
column and backfills it (main tables from id, version tables from _uuid).
Tried on the staging pg_dump: keys backfilled, second run no-op, all 14
public pages unchanged. React keys use `key`; the transfer upgrades old
bundles.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Do Siki
2026-09-29 23:40:42 +02:00
co-authored by Claude Opus 5.5
parent 244553a665
commit 4a263586aa
13 changed files with 11233 additions and 12 deletions
+4 -2
View File
@@ -73,10 +73,12 @@ function buildHomeData(json: typeof homeJson) {
trustBullets: toStringArray(hero.trustBullets),
cta: { primary: toCtaLink(hero.cta.primary), secondary: toCtaLink(hero.cta.secondary) },
},
about,
// MITHOME-138: the JSON `id` is the row key, not the row id.
about: { ...about, usps: about.usps.map(({ id, ...usp }) => ({ key: id, ...usp })) },
services: {
...services,
items: services.items.map((item) => ({
items: services.items.map(({ id, ...item }) => ({
key: id,
...item,
features: toStringArray(item.features),
})),