fix(ci) : recree l'index partiel uq_category_name_type_active apres schema:update (ERP-67)
Le workflow CI lancait `doctrine:schema:update --force` (ajoute par ERP-67 pour aligner sur le mapping ORM avant `app:apply-column-comments`) sans recreer ensuite l'index partiel `uq_category_name_type_active`. Doctrine ORM 3 ne sait pas exprimer un index fonctionnel + partiel (LOWER(name) WHERE deleted_at IS NULL), le considere donc comme orphelin et le DROP silencieusement. Resultat en CI : les tests RG-1.07 (CategoryUniqueTest) attendent 409 sur un doublon (name, type) mais recoivent 201 car la contrainte SQL n'existe plus. La cible `make test-db-setup` (ligne 222 du makefile) recreait deja l'index via `dbal:run-sql` ; on aligne le workflow CI sur le meme pas, et on ajoute un commentaire pointant vers la cause-racine pour eviter le drift au prochain refactor du workflow.
This commit is contained in:
@@ -73,6 +73,13 @@ jobs:
|
|||||||
run: vendor/bin/php-cs-fixer fix --config=.php-cs-fixer.dist.php --allow-risky=yes --dry-run --diff
|
run: vendor/bin/php-cs-fixer fix --config=.php-cs-fixer.dist.php --allow-risky=yes --dry-run --diff
|
||||||
|
|
||||||
- name: Bootstrap test database
|
- 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: |
|
run: |
|
||||||
php bin/console doctrine:database:create --env=test --if-not-exists --no-interaction
|
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:migrations:migrate --env=test --no-interaction
|
||||||
@@ -82,6 +89,7 @@ jobs:
|
|||||||
php bin/console app:apply-column-comments --env=test --no-interaction
|
php bin/console app:apply-column-comments --env=test --no-interaction
|
||||||
php bin/console doctrine:fixtures:load --env=test --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 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
|
- name: Run PHPUnit
|
||||||
run: php -d memory_limit=512M vendor/bin/phpunit
|
run: php -d memory_limit=512M vendor/bin/phpunit
|
||||||
|
|||||||
Reference in New Issue
Block a user