migrations/Version20230628075723.php line 1
<?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 Version20230628075723 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 regie_update ADD updated_by_id INT DEFAULT NULL, ADD time INT NOT NULL, CHANGE resolved_by_id event_id INT DEFAULT NULL');
$this->addSql('ALTER TABLE regie_update ADD CONSTRAINT FK_35AD68D271F7E88B FOREIGN KEY (event_id) REFERENCES event (id)');
$this->addSql('ALTER TABLE regie_update ADD CONSTRAINT FK_35AD68D2896DBBDE FOREIGN KEY (updated_by_id) REFERENCES user (id)');
$this->addSql('CREATE UNIQUE INDEX UNIQ_35AD68D271F7E88B ON regie_update (event_id)');
$this->addSql('CREATE INDEX IDX_35AD68D2896DBBDE ON regie_update (updated_by_id)');
}
public function down(Schema $schema): void
{
// this down() migration is auto-generated, please modify it to your needs
$this->addSql('ALTER TABLE regie_update DROP FOREIGN KEY FK_35AD68D271F7E88B');
$this->addSql('ALTER TABLE regie_update DROP FOREIGN KEY FK_35AD68D2896DBBDE');
$this->addSql('DROP INDEX UNIQ_35AD68D271F7E88B ON regie_update');
$this->addSql('DROP INDEX IDX_35AD68D2896DBBDE ON regie_update');
$this->addSql('ALTER TABLE regie_update ADD resolved_by_id INT DEFAULT NULL, DROP event_id, DROP updated_by_id, DROP time');
$this->addSql('ALTER TABLE regie_update ADD CONSTRAINT FK_35AD68D26713A32B FOREIGN KEY (resolved_by_id) REFERENCES user (id)');
$this->addSql('CREATE INDEX IDX_35AD68D26713A32B ON regie_update (resolved_by_id)');
}
}