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
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:
co-authored by
Claude Opus 5.5
parent
244553a665
commit
4a263586aa
@@ -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),
|
||||
})),
|
||||
|
||||
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user