Files
Inventory/migrations/Version20260325214500.php
r-dev 3a75269323 fix(composant) : replace unique constraint from name to reference validation
Remove DB unique index on composants.name and add Symfony UniqueEntity
validation on reference field with explicit error message.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-25 22:12:19 +01:00

27 lines
694 B
PHP

<?php
declare(strict_types=1);
namespace DoctrineMigrations;
use Doctrine\DBAL\Schema\Schema;
use Doctrine\Migrations\AbstractMigration;
final class Version20260325214500 extends AbstractMigration
{
public function getDescription(): string
{
return 'Remove unique constraint on composants.name (uniqueness on reference is now enforced at application level via UniqueEntity)';
}
public function up(Schema $schema): void
{
$this->addSql('DROP INDEX IF EXISTS uniq_f95a31995e237e06');
}
public function down(Schema $schema): void
{
$this->addSql('CREATE UNIQUE INDEX IF NOT EXISTS uniq_f95a31995e237e06 ON composants (name)');
}
}