Repository navigation
Repair missing product_fields.section foreign key - #713
Merged
Merged
Conversation
Older installs never got fk_product_fields_section because InitialSchema checked tables on the wrong connection. Add an idempotent upgrade repair that nullifies section=0 and fails loudly on other orphans.
6 of 16 tasks
2 tasks
Member
|
Влито. Проверил миграцию руками на dev-базе — это как раз «старый сайт» без
Исключение называет строку: На будущее, не блокеры
Попутно при проверке выяснилось, что |
6 of 16 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Описание
До #698
InitialSchemaне создавалfk_product_fields_section(проверка таблиц шла не по тому соединению). После #698 ключ появляется только на чистых установках. Старые сайты остаются без FK.Добавлена идемпотентная repair-миграция
20260912120000_repair_product_fields_section_fk.php:section = 0→NULL(наследие каста'main');RuntimeExceptionсо списком строк;Решение записано в #711: чиним, расхождение схем не оставляем.
Тип изменений
Связанные Issues
Closes #711
Связано: #695, #698
Как это было протестировано?
cd core/components/minishop3 php -l migrations/20260912120000_repair_product_fields_section_fk.php php -l tests/Modx/PhinxSchemaLiveTest.php php tests/MigrationSelfContainedTest.phpExit codes:
0.Live assert
testProductFieldsSectionForeignKeyExistsожидает зелёный jobmodx-testbenchв CI. Ручной апгрейд старой БД без FK в этом окружении не прогонялся.composer ci:php/composer test,npm run lint:ci,composer stan/ GitHub Actions CI)Конфигурация тестирования:
fix/issue-711-product-fields-section-fkСкриншоты (если применимо)
Чеклист
composer stan/ CI jobPHPStan)npm run lint:ciдля Vue)Дополнительные заметки
sectionувидит fail миграции со списком строк; это ожидаемо.