feat(skeleton) : drop skeleton JSON columns from model_types

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
Matthieu
2026-03-12 18:11:14 +01:00
parent 77c5d25cea
commit 5336dfc09d
4 changed files with 36 additions and 76 deletions

View File

@@ -73,18 +73,6 @@ class ModelType
#[Groups(['type_machine:read', 'model_type:read', 'model_type:write'])]
private ?string $description = null;
#[ORM\Column(type: Types::JSON, nullable: true, name: 'componentSkeleton')]
#[Groups(['model_type:read', 'composant:read'])]
private ?array $componentSkeleton = null;
#[ORM\Column(type: Types::JSON, nullable: true, name: 'pieceSkeleton')]
#[Groups(['model_type:read', 'piece:read'])]
private ?array $pieceSkeleton = null;
#[ORM\Column(type: Types::JSON, nullable: true, name: 'productSkeleton')]
#[Groups(['model_type:read', 'product:read'])]
private ?array $productSkeleton = null;
#[ORM\Column(type: Types::DATETIME_IMMUTABLE, name: 'createdAt')]
#[Groups(['model_type:read'])]
private DateTimeImmutable $createdAt;
@@ -227,42 +215,6 @@ class ModelType
return $this;
}
public function getComponentSkeleton(): ?array
{
return $this->componentSkeleton;
}
public function setComponentSkeleton(?array $componentSkeleton): static
{
$this->componentSkeleton = $componentSkeleton;
return $this;
}
public function getPieceSkeleton(): ?array
{
return $this->pieceSkeleton;
}
public function setPieceSkeleton(?array $pieceSkeleton): static
{
$this->pieceSkeleton = $pieceSkeleton;
return $this;
}
public function getProductSkeleton(): ?array
{
return $this->productSkeleton;
}
public function setProductSkeleton(?array $productSkeleton): static
{
$this->productSkeleton = $productSkeleton;
return $this;
}
#[Groups(['model_type:read', 'product:read', 'composant:read', 'piece:read'])]
public function getStructure(): ?array
{
@@ -428,27 +380,4 @@ class ModelType
], $this->skeletonProductRequirements->toArray()),
];
}
private function applyStructureForCategory(?array $structure, ModelCategory $category): void
{
if (ModelCategory::COMPONENT === $category) {
$this->componentSkeleton = $structure;
$this->pieceSkeleton = null;
$this->productSkeleton = null;
return;
}
if (ModelCategory::PIECE === $category) {
$this->pieceSkeleton = $structure;
$this->componentSkeleton = null;
$this->productSkeleton = null;
return;
}
$this->productSkeleton = $structure;
$this->componentSkeleton = null;
$this->pieceSkeleton = null;
}
}

View File

@@ -325,8 +325,6 @@ final class ModelTypeCategoryConversionService
$this->connection->executeStatement(
'UPDATE model_types
SET category = :cat,
componentskeleton = pieceskeleton,
pieceskeleton = NULL,
updatedat = :now
WHERE id = :id',
[
@@ -395,8 +393,6 @@ final class ModelTypeCategoryConversionService
$this->connection->executeStatement(
'UPDATE model_types
SET category = :cat,
pieceskeleton = componentskeleton,
componentskeleton = NULL,
updatedat = :now
WHERE id = :id',
[