<?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 Version20221007135351 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_status (id INT AUTO_INCREMENT NOT NULL, user_id INT DEFAULT NULL, mallette_file_id INT DEFAULT NULL, status VARCHAR(255) NOT NULL, INDEX IDX_FE797423A76ED395 (user_id), INDEX IDX_FE79742380E9FB39 (mallette_file_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB');
$this->addSql('ALTER TABLE mallette_file_status ADD CONSTRAINT FK_FE797423A76ED395 FOREIGN KEY (user_id) REFERENCES eckinox_app_users (id)');
$this->addSql('ALTER TABLE mallette_file_status ADD CONSTRAINT FK_FE79742380E9FB39 FOREIGN KEY (mallette_file_id) REFERENCES mallette_file (id)');
$this->addSql('DROP TABLE mallette_file_app_user');
$this->addSql('ALTER TABLE mallette_file DROP new');
}
public function down(Schema $schema): void
{
// this down() migration is auto-generated, please modify it to your needs
$this->addSql('CREATE TABLE mallette_file_app_user (mallette_file_id INT NOT NULL, app_user_id INT NOT NULL, INDEX IDX_BAD37C5E4A3353D8 (app_user_id), INDEX IDX_BAD37C5E80E9FB39 (mallette_file_id), PRIMARY KEY(mallette_file_id, app_user_id)) DEFAULT CHARACTER SET utf8 COLLATE `utf8_unicode_ci` ENGINE = InnoDB COMMENT = \'\' ');
$this->addSql('ALTER TABLE mallette_file_app_user ADD CONSTRAINT FK_BAD37C5E4A3353D8 FOREIGN KEY (app_user_id) REFERENCES eckinox_app_users (id) ON UPDATE NO ACTION ON DELETE CASCADE');
$this->addSql('ALTER TABLE mallette_file_app_user ADD CONSTRAINT FK_BAD37C5E80E9FB39 FOREIGN KEY (mallette_file_id) REFERENCES mallette_file (id) ON UPDATE NO ACTION ON DELETE CASCADE');
$this->addSql('DROP TABLE mallette_file_status');
$this->addSql('ALTER TABLE mallette_file ADD new TINYINT(1) NOT NULL');
}
public function isTransactional(): bool
{
return false;
}
}