<?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 Version20240528100339 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 students ADD same_dob_ssn_counter SMALLINT NOT NULL DEFAULT 0 after ssn');
$this->addSql('ALTER TABLE students DROP INDEX ssn_dob, ADD UNIQUE KEY `ssn_dob_counter` (`ssn`,`dob`,`same_dob_ssn_counter`)');
$this->addSql('UPDATE students SET same_dob_ssn_counter = 0');
}
public function down(Schema $schema): void
{
// this down() migration is auto-generated, please modify it to your needs
$this->addSql('ALTER TABLE students DROP INDEX ssn_dob_counter, ADD UNIQUE KEY `ssn_dob` (`ssn`,`dob`)');
$this->addSql('ALTER TABLE students DROP same_dob_ssn_counter');
}
}