feat(cms): MongoDB → PostgreSQL content transfer; fix two schema issues it found (MITHOME-136)
- scripts/transfer-content.ts: export (shared config + MongoDB adapter, locale 'all', drafts, upload files) and import (PostgreSQL, one transaction, refuses a non-empty target); pure helpers in src/lib/content-transfer.ts - LegalPages: the section anchor is its own field; as the array row id it was a table-wide primary key in PostgreSQL and the two pages collided - Products.status: own enumName; the default name equalled the drafts _status enum, so only draft/published were accepted - baseline migration regenerated Verified on a staging copy (disposable MongoDB + PostgreSQL on llmdev): counts match, all 14 public pages (hu/en) render identical text, partner logo loads, second import writes nothing. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 5.5
parent
e3ec6a9ac3
commit
a68fb94b61
@@ -62,6 +62,10 @@ export const Products: CollectionConfig = {
|
||||
name: 'status',
|
||||
label: 'Életciklus-állapot',
|
||||
type: 'select',
|
||||
// MITHOME-136: own PostgreSQL enum name. The default "enum_products_status"
|
||||
// is also Payload's name for the drafts `_status` enum, so the two
|
||||
// collided and only draft/published were accepted.
|
||||
enumName: 'enum_products_lifecycle_status',
|
||||
required: true,
|
||||
defaultValue: 'draft',
|
||||
options: PRODUCT_STATUSES.map((value) => ({ label: PRODUCT_STATUS_LABELS[value], value })),
|
||||
|
||||
Reference in New Issue
Block a user