Symfony 7.4 / Twig / Doctrine DBAL auf herkömmlichem PHP-Webhosting. Versionierte Blockdokumente (v1-v3) mit unveränderlichen Revisionen, getrennten Entwürfen/Veröffentlichungen und optimistischer Konflikterkennung. Visueller Editor mit Strukturbaum, Live-Vorschau, responsiven Gerätewerten, Abschnittsvorlagen, Bildmediathek, Galerien und Effekten. Öffentliche Ausgabe ohne Editor-JavaScript. Geprüft: 41 PHP-Tests / 155 Assertions, 10 JavaScript-Modelltests. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
38 lines
1.1 KiB
PHP
38 lines
1.1 KiB
PHP
<?php
|
|
|
|
namespace DoctrineMigrations;
|
|
|
|
use Doctrine\DBAL\Schema\Schema;
|
|
use Doctrine\Migrations\AbstractMigration;
|
|
|
|
final class Version20260912000300 extends AbstractMigration
|
|
{
|
|
public function getDescription(): string
|
|
{
|
|
return 'Add image library with immutable image variants and reversible archiving.';
|
|
}
|
|
|
|
public function isTransactional(): bool
|
|
{
|
|
return false;
|
|
}
|
|
|
|
public function up(Schema $schema): void
|
|
{
|
|
$media = $schema->createTable('media');
|
|
$media->addColumn('id', 'string', ['length' => 32]);
|
|
$media->addColumn('title', 'string', ['length' => 160]);
|
|
$media->addColumn('alt', 'string', ['length' => 300]);
|
|
$media->addColumn('variants', 'json');
|
|
$media->addColumn('archived', 'boolean', ['default' => false]);
|
|
$media->addColumn('version', 'integer', ['default' => 1]);
|
|
$media->addColumn('created_at', 'datetime_immutable');
|
|
$media->setPrimaryKey(['id']);
|
|
}
|
|
|
|
public function down(Schema $schema): void
|
|
{
|
|
$this->throwIrreversibleMigrationException('Restore database and media files together from a verified backup.');
|
|
}
|
|
}
|