feat(db) : documenter toutes les colonnes BDD via COMMENT ON COLUMN + garde-fou (ERP-67)
Pull Request — Quality gate / Frontend (lint + Vitest + build) (pull_request) Successful in 1m13s
Pull Request — Quality gate / Backend (PHP CS + PHPUnit) (pull_request) Failing after 1m35s

- Migration retrofit Version20260528120000 : pose COMMENT ON TABLE/COLUMN sur
  les 11 tables metier existantes (53 colonnes) via le catalogue partage
  ColumnCommentsCatalog (Shared/Infrastructure/Database).
- Commande app:apply-column-comments : rejoue le catalogue apres
  doctrine:schema:update --force (sinon l'ORM drop les commentaires absents
  du mapping PHP). Branchee dans makefile test-db-setup et workflow CI Gitea.
- Test architecture tests/Architecture/ColumnsHaveSqlCommentTest : echoue si
  une colonne public n'a pas de col_description (hors doctrine_migration_versions
  et fake_site_aware_entity). Whitelist metier vide.
- Convention documentee dans CLAUDE.md (regle ABSOLUE n°12) et
  .claude/rules/backend.md (section Migrations Doctrine) avec exemples et
  helper standardise pour les colonnes Timestampable/Blamable.
This commit is contained in:
Matthieu
2026-05-28 16:44:18 +02:00
parent 9613857650
commit 2ecfe226af
8 changed files with 469 additions and 0 deletions
+6
View File
@@ -207,10 +207,16 @@ migration-migrate:
# recree par dbal:run-sql pour que les tests RG-1.07 (unicite
# case-insensitive) voient bien la contrainte SQL. Sans ce restore, les
# POST doublons remontent 201 au lieu de 409.
# 5. app:apply-column-comments : meme cause, schema:update drop les COMMENT
# ON COLUMN/TABLE des tables managees par l'ORM (le mapping PHP ne porte
# pas d'attribut options['comment']). On rejoue le catalogue partage
# `ColumnCommentsCatalog` pour conserver la documentation SQL exigee par
# le test architecture ColumnsHaveSqlCommentTest (ERP-67).
test-db-setup:
$(SYMFONY_CONSOLE) doctrine:database:create --env=test --if-not-exists
$(SYMFONY_CONSOLE) doctrine:migrations:migrate --env=test --no-interaction
$(SYMFONY_CONSOLE) doctrine:schema:update --env=test --force
$(SYMFONY_CONSOLE) --env=test --no-interaction app:apply-column-comments
$(SYMFONY_CONSOLE) --env=test --no-interaction doctrine:fixtures:load
$(SYMFONY_CONSOLE) --env=test --no-interaction app:sync-permissions
$(SYMFONY_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"