add primary key and auto-increment schema support

Configure the page translations table with an `id` primary key and auto-increment column, and detect and apply these constraints in database schema updates. Add persistence coverage for English and German homepage routes.
This commit is contained in:
2026-11-26 07:59:07 +01:00
parent ed8ae3200b
commit 21a33e53aa
3 changed files with 71 additions and 0 deletions
@@ -430,6 +430,24 @@ $cases = [
assertPageCreation(str_contains($html, 'Each language shows its own saved values; missing translations are left blank instead of using fallback text.'), 'Locale-specific editing guidance was not shown.');
$_POST = [];
},
'homepage routes persist for the submitted English and German values' => function (): void {
resetPageCreationDatabase();
$payload = pageCreationPayload([
'name' => 'Hom',
'layout' => 'master',
'title' => ['en' => 'Home', 'de' => 'Start'],
'route' => ['en' => '/', 'de' => '/de/'],
]);
$page = (new PageRepository())->create($payload);
global $phpb_db;
$translations = $phpb_db->rows('page_translations');
assertPageCreation($page === true, 'The submitted homepage payload did not create a page.');
assertPageCreation(count($translations) === 2, 'The homepage did not persist both localized translations.');
assertPageCreation($translations[0]['route'] === '/', 'The English homepage route was not preserved.');
assertPageCreation($translations[1]['route'] === '/de/', 'The German homepage route was not preserved.');
},
'generated routes persist for every active locale' => function (): void {
resetPageCreationDatabase();