From 216f38847be19133c7061f474e4bc6f6a0e486e1 Mon Sep 17 00:00:00 2001 From: Matthieu Date: Thu, 28 May 2026 15:37:33 +0200 Subject: [PATCH] fix(ci) : recreer l'index partiel uq_category_name_type_active apres schema:update MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit doctrine:schema:update --force drop l'index unique partiel cree par la migration M0 Catalog (LOWER(name), category_type_id) WHERE deleted_at IS NULL : Doctrine ORM ne sait pas exprimer les index fonctionnels partiels via les mappings, donc le voit comme orphelin. Resultat : en CI les tests CategoryUniqueTest::testDuplicateName* attendent un 409 (collision) et recoivent 201 — l'index unique n'existant plus, le doublon passe. Aligne le step CI sur la cible makefile test-db-setup qui recreait deja l'index manuellement apres schema:update. --- .gitea/workflows/pull-request.yml | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/.gitea/workflows/pull-request.yml b/.gitea/workflows/pull-request.yml index c161627..c0f9425 100644 --- a/.gitea/workflows/pull-request.yml +++ b/.gitea/workflows/pull-request.yml @@ -73,12 +73,20 @@ jobs: run: vendor/bin/php-cs-fixer fix --config=.php-cs-fixer.dist.php --allow-risky=yes --dry-run --diff - name: Bootstrap test database + # Aligne sur la cible `test-db-setup` du makefile : apres + # `schema:update --force`, on RECREE manuellement l'index unique + # partiel `uq_category_name_type_active` car Doctrine ORM ne sait + # pas exprimer les index fonctionnels partiels (LOWER(name) + WHERE + # deleted_at IS NULL) et `schema:update` les considere comme + # orphelins et les DROP — collisions non detectees, tests d'unicite + # qui attendent 409 recoivent 201. run: | php bin/console doctrine:database:create --env=test --if-not-exists --no-interaction php bin/console doctrine:migrations:migrate --env=test --no-interaction php bin/console doctrine:schema:update --env=test --force --no-interaction php bin/console doctrine:fixtures:load --env=test --no-interaction php bin/console app:sync-permissions --env=test --no-interaction + php bin/console --env=test dbal:run-sql "CREATE UNIQUE INDEX IF NOT EXISTS uq_category_name_type_active ON category (LOWER(name), category_type_id) WHERE deleted_at IS NULL" - name: Run PHPUnit run: php -d memory_limit=512M vendor/bin/phpunit