<?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 Version20230914204737 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('ALTER TABLE tag_scan DROP PRIMARY KEY');
$this->addSql('ALTER TABLE tag_scan ADD PRIMARY KEY (scan_id, tag_type)');
$this->addSql('DROP INDEX UNIQ_389B783EA750E8 ON tag');
$this->addSql('DROP INDEX UNIQ_389B7838EA2F0ED ON tag');
$this->addSql('ALTER TABLE tag DROP label, DROP short_label');
}
public function down(Schema $schema): void
{
// this down() migration is auto-generated, please modify it to your needs
$this->addSql('ALTER TABLE tag ADD label VARCHAR(50) NOT NULL, ADD short_label VARCHAR(5) NOT NULL');
$this->addSql('CREATE UNIQUE INDEX UNIQ_389B783EA750E8 ON tag (label)');
$this->addSql('CREATE UNIQUE INDEX UNIQ_389B7838EA2F0ED ON tag (short_label)');
$this->addSql('ALTER TABLE tag_scan DROP PRIMARY KEY');
$this->addSql('ALTER TABLE tag_scan ADD PRIMARY KEY (tag_type, scan_id)');
}
}