<?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 Version20211116101230 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 record ADD validator_id INT DEFAULT NULL, ADD validated_at DATETIME DEFAULT NULL');
$this->addSql('ALTER TABLE record ADD CONSTRAINT FK_9B349F91B0644AEC FOREIGN KEY (validator_id) REFERENCES user (id)');
$this->addSql('CREATE INDEX IDX_9B349F91B0644AEC ON record (validator_id)');
$this->addSql('ALTER TABLE resource ADD validator_id INT DEFAULT NULL, ADD validated_at DATETIME DEFAULT NULL');
$this->addSql('ALTER TABLE resource ADD CONSTRAINT FK_BC91F416B0644AEC FOREIGN KEY (validator_id) REFERENCES user (id)');
$this->addSql('CREATE INDEX IDX_BC91F416B0644AEC ON resource (validator_id)');
$this->addSql('ALTER TABLE scenario ADD validator_id INT DEFAULT NULL, ADD validated_at DATETIME DEFAULT NULL');
$this->addSql('ALTER TABLE scenario ADD CONSTRAINT FK_3E45C8D8B0644AEC FOREIGN KEY (validator_id) REFERENCES user (id)');
$this->addSql('CREATE INDEX IDX_3E45C8D8B0644AEC ON scenario (validator_id)');
}
public function down(Schema $schema): void
{
// this down() migration is auto-generated, please modify it to your needs
$this->addSql('ALTER TABLE record DROP FOREIGN KEY FK_9B349F91B0644AEC');
$this->addSql('DROP INDEX IDX_9B349F91B0644AEC ON record');
$this->addSql('ALTER TABLE record DROP validator_id, DROP validated_at');
$this->addSql('ALTER TABLE resource DROP FOREIGN KEY FK_BC91F416B0644AEC');
$this->addSql('DROP INDEX IDX_BC91F416B0644AEC ON resource');
$this->addSql('ALTER TABLE resource DROP validator_id, DROP validated_at');
$this->addSql('ALTER TABLE scenario DROP FOREIGN KEY FK_3E45C8D8B0644AEC');
$this->addSql('DROP INDEX IDX_3E45C8D8B0644AEC ON scenario');
$this->addSql('ALTER TABLE scenario DROP validator_id, DROP validated_at');
}
}