Files
KantSites/tests/TestSchema.php
T
kantarciandClaude Opus 5 e8a9dcdf5c Upload PDFs to the library, link them from any link target, show them in a viewer
PDFs go through the same upload field as images, are checked by their content and kept
unchanged in their own table. Every link field can pick one, and a page that links a PDF
opens it in a dialog with the browser's own viewer; touch devices and browsers without a
viewer get a new tab instead.

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

69 lines
2.5 KiB
PHP

<?php
namespace App\Tests;
use Doctrine\DBAL\Connection;
use Doctrine\DBAL\Schema\Schema;
use DoctrineMigrations\Version20260912000100;
use DoctrineMigrations\Version20260912000200;
use DoctrineMigrations\Version20260912000300;
use DoctrineMigrations\Version20260912000400;
use DoctrineMigrations\Version20260912000500;
use DoctrineMigrations\Version20260912000600;
use DoctrineMigrations\Version20260912000700;
use DoctrineMigrations\Version20260912000800;
use DoctrineMigrations\Version20260912000900;
use DoctrineMigrations\Version20260912001000;
use DoctrineMigrations\Version20260912001100;
use DoctrineMigrations\Version20260912001200;
use DoctrineMigrations\Version20260912001300;
use DoctrineMigrations\Version20260913000100;
use DoctrineMigrations\Version20260914000100;
use DoctrineMigrations\Version20260915000100;
use DoctrineMigrations\Version20260916000100;
use DoctrineMigrations\Version20260917000100;
use Psr\Log\NullLogger;
/**
* The schema a migrated installation has, built for a fresh test database.
*
* The list used to stand in three places, so a new migration was three edits and the fixtures
* drifted apart. It stands here once. Indexes come from the same postUp() helpers the migrations
* use, because on SQLite an index added the ordinary way rebuilds the table.
*/
final class TestSchema
{
public static function build(Connection $db): void
{
$schema = new Schema();
foreach ([
Version20260912000100::class,
Version20260912000200::class,
Version20260912000300::class,
Version20260912000400::class,
Version20260912000500::class,
Version20260912000600::class,
Version20260912000700::class,
Version20260912000800::class,
Version20260912000900::class,
Version20260912001000::class,
Version20260912001100::class,
Version20260912001200::class,
Version20260912001300::class,
Version20260913000100::class,
Version20260914000100::class,
Version20260915000100::class,
Version20260916000100::class,
Version20260917000100::class,
] as $migration) {
(new $migration($db, new NullLogger()))->up($schema);
}
foreach ($schema->toSql($db->getDatabasePlatform()) as $sql) {
$db->executeStatement($sql);
}
Version20260912000400::applyIndexes($db);
Version20260912000600::applyIndexes($db);
Version20260912000900::applyIndexes($db);
}
}