<?php
declare(strict_types=1);
namespace DoctrineMigrations;
use Doctrine\DBAL\Schema\Schema;
use Doctrine\Migrations\AbstractMigration;
/**
* Auto-generated Migration: Please modify to your needs!
*
* @SuppressWarnings(PHPMD.UnusedFormalParameter)
*/
final class Version20221005170455 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 mallette_file_notification_mallette_file (mallette_file_notification_id INT NOT NULL, mallette_file_id INT NOT NULL, INDEX IDX_66DFEDD7990EB3A1 (mallette_file_notification_id), INDEX IDX_66DFEDD780E9FB39 (mallette_file_id), PRIMARY KEY(mallette_file_notification_id, mallette_file_id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB');
$this->addSql('ALTER TABLE mallette_file_notification_mallette_file ADD CONSTRAINT FK_66DFEDD7990EB3A1 FOREIGN KEY (mallette_file_notification_id) REFERENCES mallette_file_notification (id) ON DELETE CASCADE');
$this->addSql('ALTER TABLE mallette_file_notification_mallette_file ADD CONSTRAINT FK_66DFEDD780E9FB39 FOREIGN KEY (mallette_file_id) REFERENCES mallette_file (id) ON DELETE CASCADE');
$this->addSql('DROP TABLE mallette_file_notification_app_user');
$this->addSql('ALTER TABLE mallette_file_notification DROP FOREIGN KEY FK_E6314BFD80E9FB39');
$this->addSql('DROP INDEX IDX_E6314BFD80E9FB39 ON mallette_file_notification');
$this->addSql('ALTER TABLE mallette_file_notification ADD user_id INT DEFAULT NULL, DROP mallette_file_id');
$this->addSql('ALTER TABLE mallette_file_notification ADD CONSTRAINT FK_E6314BFDA76ED395 FOREIGN KEY (user_id) REFERENCES eckinox_app_users (id)');
$this->addSql('CREATE INDEX IDX_E6314BFDA76ED395 ON mallette_file_notification (user_id)');
}
public function down(Schema $schema): void
{
// this down() migration is auto-generated, please modify it to your needs
$this->addSql('CREATE TABLE mallette_file_notification_app_user (mallette_file_notification_id INT NOT NULL, app_user_id INT NOT NULL, INDEX IDX_7B3A1A864A3353D8 (app_user_id), INDEX IDX_7B3A1A86990EB3A1 (mallette_file_notification_id), PRIMARY KEY(mallette_file_notification_id, app_user_id)) DEFAULT CHARACTER SET utf8 COLLATE `utf8_unicode_ci` ENGINE = InnoDB COMMENT = \'\' ');
$this->addSql('ALTER TABLE mallette_file_notification_app_user ADD CONSTRAINT FK_7B3A1A864A3353D8 FOREIGN KEY (app_user_id) REFERENCES eckinox_app_users (id) ON UPDATE NO ACTION ON DELETE CASCADE');
$this->addSql('ALTER TABLE mallette_file_notification_app_user ADD CONSTRAINT FK_7B3A1A86990EB3A1 FOREIGN KEY (mallette_file_notification_id) REFERENCES mallette_file_notification (id) ON UPDATE NO ACTION ON DELETE CASCADE');
$this->addSql('DROP TABLE mallette_file_notification_mallette_file');
$this->addSql('ALTER TABLE mallette_file_notification DROP FOREIGN KEY FK_E6314BFDA76ED395');
$this->addSql('DROP INDEX IDX_E6314BFDA76ED395 ON mallette_file_notification');
$this->addSql('ALTER TABLE mallette_file_notification ADD mallette_file_id INT NOT NULL, DROP user_id');
$this->addSql('ALTER TABLE mallette_file_notification ADD CONSTRAINT FK_E6314BFD80E9FB39 FOREIGN KEY (mallette_file_id) REFERENCES mallette_file (id) ON UPDATE NO ACTION ON DELETE NO ACTION');
$this->addSql('CREATE INDEX IDX_E6314BFD80E9FB39 ON mallette_file_notification (mallette_file_id)');
}
public function isTransactional(): bool
{
return false;
}
}