Files
websitedev/proto/src/payload.config.ts
T
Do SikiandClaude Opus 5.5 e3ec6a9ac3 feat(cms): switch Payload to PostgreSQL with a fresh baseline migration (MITHOME-136)
- postgresAdapter (uuid ids, no push, prodMigrations), DATABASE_URI
- src/payload.shared.ts: the config without the db adapter, shared with the
  one-off MongoDB content transfer
- baseline migration 20260929_200306_initial (86 tables; applied twice on a
  disposable PostgreSQL 16: second run is a no-op)
- seed copy (references, hosting plans) moved to src/content/seeds/
- MongoDB data migrations, their helpers/tests and the dead lib/mongodb.ts
  removed (kept in git history)
- npm scripts for the Payload CLI (works now that the package is ESM)

Branch only: staging has no PostgreSQL yet (tasks 3.x).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-09-29 22:09:00 +02:00

49 lines
2.4 KiB
TypeScript

/**
* Payload CMS configuration (MITHOME-86 — alapinstalláció).
*
* MITHOME-136: PostgreSQL (`postgresAdapter`) — a platform egy PostgreSQL-
* szervert használ, a weboldal saját adatbázissal (mitplatform ADR-0001).
* A MongoDB-korszak adatmigrációi a git-előzményben vannak; a tartalom
* egyszeri átvitele: scripts/transfer-content.ts.
*
* MITHOME-87: Home/About/Services/Contact/Common Globals hozzáadva — ezek
* tükrözik a proto/src/content/pages/*.json + common.json struktúráját.
* MITHOME-88: LegalPages collection hozzáadva (adatvedelem, hasznalati-
* feltetelek).
* MITHOME-89: Partners + Media collection (MVP — feltöltés, a vágás/
* áttetszővé tétel szerkesztő külön, MITHOME-118).
* MITHOME-110: lokalizáció bekapcsolva (hu alapértelmezett, en). A mezőnkénti
* `localized: true` retrofit a Globals/LegalPages configokon külön ticket
* (MITHOME-111/112) — ez a ticket csak magát a mechanizmust kapcsolja be.
* MITHOME-120: admin gyorskeresés (QuickSearch) az admin.components.header
* slotba regisztrálva — teljes szöveges keresés minden Global/Collection
* mezőjében, mindkét locale-ban.
* MITHOME-94: ContactSubmissions collection — a /api/contact korábban egy
* nyers, Payload-on kívüli Mongo collection-be (`contact_submissions`,
* proto/src/lib/mongodb.ts) írt, amit az ügyfél nem látott sehol az admin
* felületen. Mostantól Payload collection, a route.ts a Local API-n ír bele.
* MITHOME-111: a Globals fordítható mezői lokalizáltak.
* MITHOME-130: Products collection + HostingPlans global (tárhelycsomagok).
*/
import { buildConfig } from 'payload'
import { postgresAdapter } from '@payloadcms/db-postgres'
import { sharedConfig } from './payload.shared'
import { migrations } from './migrations'
export default buildConfig({
...sharedConfig,
db: postgresAdapter({
pool: { connectionString: process.env.DATABASE_URI || '' },
// WHY uuid: opaque ids that do not reveal record counts and never clash
// when content is transferred or joined with the catalogue (PLATFM-15).
idType: 'uuid',
// WHY no push: the schema changes only through migrations, the same way
// locally, on staging and in production.
push: false,
// Pending migrations run automatically on production-mode startup
// (staging + prod containers) before the site serves requests.
prodMigrations: migrations,
}),
})