# Spec Delta ## ADDED Requirements ### Requirement: Relational content storage The CMS SHALL store all site content, media metadata, contact submissions and users in a PostgreSQL database dedicated to the website, separate from other databases on the same server. The database schema SHALL change only through versioned migrations that run automatically on production-mode startup before the site serves requests. #### Scenario: Startup with a pending schema migration - **WHEN** a new release with a pending schema migration starts in production mode - **THEN** the migration SHALL be applied before the site serves content, and a second start SHALL apply nothing #### Scenario: Separate databases on one server - **WHEN** the website connects to the PostgreSQL server - **THEN** it SHALL use its own database and credentials and SHALL NOT be able to write to the product catalogue database ### Requirement: Lossless migration of existing content to PostgreSQL The existing MongoDB content SHALL be transferred to PostgreSQL once, before the production launch. For every global and collection the published state in both locales and any open draft SHALL be preserved; media documents SHALL keep their files and references; contact submissions SHALL be preserved. Public pages SHALL render the same content before and after the migration. #### Scenario: Compare public pages after the migration - **WHEN** the migration has run on a copy of the staging data - **THEN** the document counts per global and collection SHALL match, and the rendered text of every public page in Hungarian and English SHALL equal the pre-migration snapshot #### Scenario: Partner logo references survive - **WHEN** a partner referenced a media document before the migration - **THEN** it SHALL reference the migrated media document with the same file afterwards #### Scenario: Re-running the migration - **WHEN** the migration script runs again on the same target - **THEN** it SHALL detect the existing data and change nothing