<?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 Version20231216175002 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('TRUNCATE TABLE score');
$this->addSql('ALTER TABLE score DROP FOREIGN KEY FK_329937519E6B1585');
$this->addSql('DROP INDEX IDX_329937519E6B1585 ON score');
$this->addSql('ALTER TABLE score CHANGE organisation_id domain_id INT NOT NULL');
$this->addSql('ALTER TABLE score ADD CONSTRAINT FK_32993751115F0EE5 FOREIGN KEY (domain_id) REFERENCES domain (id)');
$this->addSql('CREATE INDEX IDX_32993751115F0EE5 ON score (domain_id)');
}
public function down(Schema $schema): void
{
// this down() migration is auto-generated, please modify it to your needs
$this->addSql('ALTER TABLE score DROP FOREIGN KEY FK_32993751115F0EE5');
$this->addSql('DROP INDEX IDX_32993751115F0EE5 ON score');
$this->addSql('ALTER TABLE score CHANGE domain_id organisation_id INT NOT NULL');
$this->addSql('ALTER TABLE score ADD CONSTRAINT FK_329937519E6B1585 FOREIGN KEY (organisation_id) REFERENCES organisation (id) ON UPDATE NO ACTION ON DELETE NO ACTION');
$this->addSql('CREATE INDEX IDX_329937519E6B1585 ON score (organisation_id)');
}
}