migrations/Version20230619125724.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 Version20230619125724 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('CREATE TABLE regie_update (id INT AUTO_INCREMENT NOT NULL, ticket_id INT DEFAULT NULL, regie_id INT DEFAULT NULL, resolved_by_id INT DEFAULT NULL, UNIQUE INDEX UNIQ_35AD68D2700047D2 (ticket_id), UNIQUE INDEX UNIQ_35AD68D246F21B0B (regie_id), INDEX IDX_35AD68D26713A32B (resolved_by_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB');
$this->addSql('ALTER TABLE regie_update ADD CONSTRAINT FK_35AD68D2700047D2 FOREIGN KEY (ticket_id) REFERENCES ticket (id)');
$this->addSql('ALTER TABLE regie_update ADD CONSTRAINT FK_35AD68D246F21B0B FOREIGN KEY (regie_id) REFERENCES regie (id)');
$this->addSql('ALTER TABLE regie_update ADD CONSTRAINT FK_35AD68D26713A32B FOREIGN KEY (resolved_by_id) REFERENCES user (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_35AD68D2700047D2');
$this->addSql('ALTER TABLE regie_update DROP FOREIGN KEY FK_35AD68D246F21B0B');
$this->addSql('ALTER TABLE regie_update DROP FOREIGN KEY FK_35AD68D26713A32B');
$this->addSql('DROP TABLE regie_update');
}
}