feat(normalization) : drop structure and productIds JSON columns

- Remove Composant.structure property, getter/setter
- Remove Piece.productIds property, setProductIds()
- Update fixtures to remove dropped columns
- Add migrations to drop both columns

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
Matthieu
2026-03-13 08:19:54 +01:00
parent 8ed5f90b63
commit a6139d7090
8 changed files with 179 additions and 173 deletions

View File

@@ -0,0 +1,30 @@
<?php
declare(strict_types=1);
namespace DoctrineMigrations;
use Doctrine\DBAL\Schema\Schema;
use Doctrine\Migrations\AbstractMigration;
/**
* Drop the legacy productIds JSON column from pieces table.
* Data has been migrated to the piece_products join table.
*/
final class Version20260312200000 extends AbstractMigration
{
public function getDescription(): string
{
return 'Drop legacy productIds JSON column from pieces table';
}
public function up(Schema $schema): void
{
$this->addSql('ALTER TABLE pieces DROP COLUMN IF EXISTS productids');
}
public function down(Schema $schema): void
{
$this->addSql('ALTER TABLE pieces ADD COLUMN productids JSON DEFAULT NULL');
}
}

View File

@@ -0,0 +1,30 @@
<?php
declare(strict_types=1);
namespace DoctrineMigrations;
use Doctrine\DBAL\Schema\Schema;
use Doctrine\Migrations\AbstractMigration;
/**
* Drop the legacy structure JSON column from composants table.
* Data has been migrated to composant_piece_slots, composant_subcomponent_slots, composant_product_slots tables.
*/
final class Version20260312210000 extends AbstractMigration
{
public function getDescription(): string
{
return 'Drop legacy structure JSON column from composants table';
}
public function up(Schema $schema): void
{
$this->addSql('ALTER TABLE composants DROP COLUMN IF EXISTS structure');
}
public function down(Schema $schema): void
{
$this->addSql('ALTER TABLE composants ADD COLUMN structure JSON DEFAULT NULL');
}
}