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
+3 -2
View File
@@ -155,8 +155,9 @@ async function importBundle(file: string) {
}
for (const g of globals) {
const entry = bundle.globals[g.slug]
if (!entry) continue
const raw = bundle.globals[g.slug]
if (!raw) continue
const entry: BundleDoc = { published: upgradeDoc(g.slug, raw.published), ...(raw.draft ? { draft: upgradeDoc(g.slug, raw.draft) } : {}) }
const slug = g.slug as GlobalSlug
const status = hasDrafts(g) ? { _status: 'published' } : {}
for (const locale of LOCALES) {