<?php
declare(strict_types=1);
namespace DoctrineMigrations;
use Doctrine\DBAL\Schema\Schema;
use Doctrine\Migrations\AbstractMigration;
/**
* Auto-generated Migration: Please modify to your needs!
*/
final class Version20250930130225 extends AbstractMigration
{
public function getDescription(): string
{
return '';
}
public function up(Schema $schema): void
{
// this up() migration is auto-generated, please modify it to your needs
$this->addSql('DROP INDEX UNIQ_989D9B621D775834 ON slug');
$this->addSql('ALTER TABLE slug ADD lang_id INT NOT NULL');
$this->addSql('ALTER TABLE slug ADD CONSTRAINT FK_989D9B62B213FA4 FOREIGN KEY (lang_id) REFERENCES language (id)');
$this->addSql('CREATE INDEX idx_slug_lang ON slug (lang_id)');
$this->addSql('CREATE UNIQUE INDEX unique_value_entity_lang ON slug (value, entity_type, lang_id)');
}
public function down(Schema $schema): void
{
// this down() migration is auto-generated, please modify it to your needs
$this->addSql('CREATE UNIQUE INDEX UNIQ_989D9B621D775834 ON slug (value)');
$this->addSql('DROP INDEX idx_slug_lang ON slug');
$this->addSql('DROP INDEX unique_value_entity_lang ON slug');
$this->addSql('ALTER TABLE slug DROP lang_id');
$this->addSql('CREATE UNIQUE INDEX unique_value_entity ON slug (value, entity_type)');
}
}