Files
KantSites/tests/TestSchema.php
T
kantarciandClaude Opus 5.5 76613b9f8e Add videos: library, block and section background
Videos join the media library as their own table (schema v28), with a
video block and a looping background on sections. video.js starts loops
only while visible, offers a pause button and leaves the still image for
reduced motion and data saving.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01PWYm8kjAWmZaB2QB2xuBhU
2026-11-05 05:23:17 +00:00

75 lines
2.8 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 DoctrineMigrations\Version20261009000100;
use DoctrineMigrations\Version20261012000100;
use DoctrineMigrations\Version20261104000100;
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,
Version20261009000100::class,
Version20261012000100::class,
Version20261104000100::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);
}
}