Migration 20260912001000 legt die Tabelle partial an: Blockdokumente, die keine Seiten sind. Kopf- und Fußbereich je einmal, wiederverwendbare Sektionen beliebig viele - im selben Editor gestaltbar wie eine Seite, weil der Editor seine Schnittstelle aus einem Datenattribut nimmt statt sie fest zu kennen. Im Template steht keine Marke und keine Navigation mehr. Ein neuer Block menu zeigt einen Menüplatz; die Einträge bleiben in der Menüverwaltung. Eine Seite braucht genau eine Hauptüberschrift, ein geteilter Bereich keine - sonst hätte jede Seite, die ihn trägt, zwei. Geteilte Bereiche haben keinen Entwurf und keine Veröffentlichung: sie sind überall sichtbar, gespeichert heißt live. Verknüpft statt kopiert: partialref speichert nur die Adresse, die Blöcke bleiben im Bereich, und eine Änderung erreicht jede Seite, die sie einbindet. Zyklen abgewiesen, Verschachtelung auf drei Ebenen begrenzt, eine entfernte Sektion hinterlässt keine Lücke und der Verweis bleibt erhalten. Die Abschnittsvorlagen kopieren weiterhin. Ein echter Fehler kam dabei heraus, der jede dunkle Sektion mit Spalten betraf: .block-column>.block-text:first-child setzt eine Farbe für helle Hintergründe und gewinnt auf Spezifität gegen .tone-ink - gemessen 1,87:1. Geprüft: 165 PHP-Tests / 660 Assertions unter PHP 8.2.12 und 8.4.22, 15 JavaScript-Modelltests, Editortest mit axe ohne Verstöße, öffentliche Browserprüfung, Migration nach Backup angewendet. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
41 lines
1.5 KiB
PHP
41 lines
1.5 KiB
PHP
<?php
|
|
|
|
namespace DoctrineMigrations;
|
|
|
|
use Doctrine\DBAL\Schema\Schema;
|
|
use Doctrine\Migrations\AbstractMigration;
|
|
|
|
final class Version20260912001000 extends AbstractMigration
|
|
{
|
|
public function getDescription(): string
|
|
{
|
|
return 'Editable header and footer areas plus reusable sections as block documents.';
|
|
}
|
|
|
|
public function isTransactional(): bool
|
|
{
|
|
return false;
|
|
}
|
|
|
|
public function up(Schema $schema): void
|
|
{
|
|
$partial = $schema->createTable('partial');
|
|
$partial->addColumn('id', 'string', ['length' => 64]);
|
|
$partial->addColumn('website_id', 'string', ['length' => 64]);
|
|
$partial->addColumn('locale', 'string', ['length' => 12]);
|
|
// 'header' and 'footer' exist once each; 'section' is a reusable block any page can link.
|
|
$partial->addColumn('kind', 'string', ['length' => 16]);
|
|
$partial->addColumn('slug', 'string', ['length' => 80]);
|
|
$partial->addColumn('name', 'string', ['length' => 120]);
|
|
$partial->addColumn('document', 'json');
|
|
$partial->addColumn('version', 'integer', ['default' => 0]);
|
|
$partial->setPrimaryKey(['id']);
|
|
$partial->addUniqueIndex(['website_id', 'locale', 'kind', 'slug'], 'uniq_partial_slug');
|
|
}
|
|
|
|
public function down(Schema $schema): void
|
|
{
|
|
$this->throwIrreversibleMigrationException('Contains the header, the footer and every reusable section. Restore a verified database backup with matching code.');
|
|
}
|
|
}
|