migrations/Version20230703091721.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 Version20230703091721 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 event DROP FOREIGN KEY FK_3BAE0AA719EB6921');
$this->addSql('ALTER TABLE event ADD CONSTRAINT FK_3BAE0AA719EB6921 FOREIGN KEY (client_id) REFERENCES client (id)');
$this->addSql('ALTER TABLE file DROP FOREIGN KEY FK_8C9F3610700047D2');
$this->addSql('ALTER TABLE file DROP FOREIGN KEY FK_8C9F3610537A1329');
$this->addSql('ALTER TABLE file ADD CONSTRAINT FK_8C9F3610700047D2 FOREIGN KEY (ticket_id) REFERENCES ticket (id)');
$this->addSql('ALTER TABLE file ADD CONSTRAINT FK_8C9F3610537A1329 FOREIGN KEY (message_id) REFERENCES message (id)');
$this->addSql('ALTER TABLE message DROP FOREIGN KEY FK_B6BD307F700047D2');
$this->addSql('ALTER TABLE message ADD CONSTRAINT FK_B6BD307F700047D2 FOREIGN KEY (ticket_id) REFERENCES ticket (id)');
}
public function down(Schema $schema): void
{
// this down() migration is auto-generated, please modify it to your needs
$this->addSql('ALTER TABLE file DROP FOREIGN KEY FK_8C9F3610700047D2');
$this->addSql('ALTER TABLE file DROP FOREIGN KEY FK_8C9F3610537A1329');
$this->addSql('ALTER TABLE file ADD CONSTRAINT FK_8C9F3610700047D2 FOREIGN KEY (ticket_id) REFERENCES ticket (id) ON DELETE CASCADE');
$this->addSql('ALTER TABLE file ADD CONSTRAINT FK_8C9F3610537A1329 FOREIGN KEY (message_id) REFERENCES message (id) ON DELETE CASCADE');
$this->addSql('ALTER TABLE message DROP FOREIGN KEY FK_B6BD307F700047D2');
$this->addSql('ALTER TABLE message ADD CONSTRAINT FK_B6BD307F700047D2 FOREIGN KEY (ticket_id) REFERENCES ticket (id) ON DELETE CASCADE');
$this->addSql('ALTER TABLE event DROP FOREIGN KEY FK_3BAE0AA719EB6921');
$this->addSql('ALTER TABLE event ADD CONSTRAINT FK_3BAE0AA719EB6921 FOREIGN KEY (ticket_id) REFERENCES client (id) ON DELETE CASCADE');
}
}