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>
36 lines
1.0 KiB
PHP
36 lines
1.0 KiB
PHP
<?php
|
|
|
|
namespace DoctrineMigrations;
|
|
|
|
use Doctrine\DBAL\Schema\Schema;
|
|
use Doctrine\Migrations\AbstractMigration;
|
|
|
|
final class Version20260912000200 extends AbstractMigration
|
|
{
|
|
public function getDescription(): string
|
|
{
|
|
return 'Add CMS users without changing existing pages or revisions.';
|
|
}
|
|
|
|
public function isTransactional(): bool
|
|
{
|
|
return false;
|
|
}
|
|
|
|
public function up(Schema $schema): void
|
|
{
|
|
$users = $schema->createTable('cms_user');
|
|
$users->addColumn('id', 'string', ['length' => 64]);
|
|
$users->addColumn('username', 'string', ['length' => 100]);
|
|
$users->addColumn('password_hash', 'string', ['length' => 255]);
|
|
$users->addColumn('roles', 'json');
|
|
$users->setPrimaryKey(['id']);
|
|
$users->addUniqueIndex(['username']);
|
|
}
|
|
|
|
public function down(Schema $schema): void
|
|
{
|
|
$this->throwIrreversibleMigrationException('Contains account data. Restore the verified database backup with matching code.');
|
|
}
|
|
}
|