<?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 Version20240912122456 extends AbstractMigration
{
public function getDescription(): string
{
return '';
}
public function up(Schema $schema): void
{
$this->addSql('DROP INDEX uniq_d55937b8f01a3f03604ef57a2832eb1c');
$this->addSql('ALTER TABLE v2_user_percent ADD ref_type VARCHAR(20) DEFAULT NULL');
$this->addSql('ALTER TABLE v2_user_percent RENAME COLUMN ins_user_id TO ins_recipient_id');
$this->addSql('ALTER TABLE v2_user_percent RENAME COLUMN ins_model_id TO ins_source_id');
$this->addSql('CREATE UNIQUE INDEX UNIQ_D55937B88DC2A8571B9BC8DA2832EB1C9BAD16AE ON v2_user_percent (ins_recipient_id, ins_source_id, reporting_period_id, ref_type)');
}
public function down(Schema $schema): void
{
$this->addSql('DROP INDEX UNIQ_D55937B88DC2A8571B9BC8DA2832EB1C9BAD16AE');
$this->addSql('ALTER TABLE v2_user_percent DROP ref_type');
$this->addSql('ALTER TABLE v2_user_percent RENAME COLUMN ins_recipient_id TO ins_user_id');
$this->addSql('ALTER TABLE v2_user_percent RENAME COLUMN ins_source_id TO ins_model_id');
$this->addSql('CREATE UNIQUE INDEX uniq_d55937b8f01a3f03604ef57a2832eb1c ON v2_user_percent (ins_user_id, ins_model_id, reporting_period_id)');
}
}