feat(catalog) : M7 — migration table storage (ERP-211) #163
Reference in New Issue
Block a user
Delete Branch "feat/erp-211-migration-storage"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
M7 · ERP-211 (1.2) — Migrer la table
storageCréation du schéma
storage(emplacements de stockage). Pattern miroir de la migration M6Version20260625110000(product/storage_type).Table
storageid INT GENERATED BY DEFAULT AS IDENTITYPKsite_id→site(id)ON DELETE RESTRICTstorage_type_id→storage_type(id)ON DELETE RESTRICT (référentiel M6 réutilisé)numero VARCHAR(50) NOT NULLstates JSONB NOT NULL— pas de DEFAULT (un'[]'violerait le CHECK ; miroir deproduct.states, valeur toujours posée par l'app)deleted_at TIMESTAMP(0)+ 4 colonnes Timestampable/BlamableCONSTRAINT chk_storage_states_not_empty CHECK (jsonb_array_length(states) >= 1)— RG-7.04Index
uq_storage_site_type_numero_activeUNIQUE(site_id, storage_type_id, numero) WHERE deleted_at IS NULL— RG-7.01 (numéro réutilisable après soft-delete)idx_storage_site,idx_storage_storage_type,idx_storage_deleted_at,idx_storage_created_by,idx_storage_updated_byConventions
DoctrineMigrations(règle n°11 — FK cross-module).down()symétrique (DROP TABLE storage).COMMENT ON TABLE+COMMENT ON COLUMNsur les 10 colonnes (règle n°12, FR ≤200 car.) ; les 4 standard viaColumnCommentsCatalog::timestampableBlamableComments().Vérifications
make db-reset(chaîne complète de migrations) OK ; migrationVersion20260629120000appliquée.down()puisup()symétriques.COMMENT ON TABLE, CHECKchk_storage_states_not_empty, index unique partiel + 5 index présents.make php-cs-fixer-allow-risky: 0 fichier à corriger.make test:ColumnsHaveSqlCommentTestvert ; échecs résiduels = flaky JWT connu (changent à chaque run, modules non liés ; tous verts en isolation).Note
Pas d'entité ORM
Storageà ce stade → en TEST,schema:update --forcedrope la table (sans impact, aucun test ne la référence ; dev/prod via migrations). Sa description rejouable sera ajoutée àColumnCommentsCatalogau ticket entité (commeproduct).