<?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 Version20220624134421 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 nda_file (id INT AUTO_INCREMENT NOT NULL, name VARCHAR(255) NOT NULL, path VARCHAR(255) NOT NULL, PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB');
$this->addSql('CREATE TABLE resources_ndafile_signatory (resources_id INT NOT NULL, nda_file_id INT NOT NULL, INDEX IDX_71B05CB5ACFC5BFF (resources_id), INDEX IDX_71B05CB578907A47 (nda_file_id), PRIMARY KEY(resources_id, nda_file_id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB');
$this->addSql('ALTER TABLE resources_ndafile_signatory ADD CONSTRAINT FK_71B05CB5ACFC5BFF FOREIGN KEY (resources_id) REFERENCES nda_file (id)');
$this->addSql('ALTER TABLE resources_ndafile_signatory ADD CONSTRAINT FK_71B05CB578907A47 FOREIGN KEY (nda_file_id) REFERENCES resource (id)');
$this->addSql('ALTER TABLE resource CHANGE isAgent isAgent TINYINT(1) DEFAULT 0 NOT NULL');
$this->addSql('ALTER TABLE scenario_project ADD nda_file_id INT DEFAULT NULL, CHANGE max_scenario_duration max_scenario_duration NUMERIC(10, 2) DEFAULT \'0\' NOT NULL');
$this->addSql('ALTER TABLE scenario_project ADD CONSTRAINT FK_307510EE78907A47 FOREIGN KEY (nda_file_id) REFERENCES nda_file (id)');
$this->addSql('CREATE INDEX IDX_307510EE78907A47 ON scenario_project (nda_file_id)');
}
public function down(Schema $schema): void
{
// this down() migration is auto-generated, please modify it to your needs
$this->addSql('ALTER TABLE resources_ndafile_signatory DROP FOREIGN KEY FK_71B05CB5ACFC5BFF');
$this->addSql('ALTER TABLE scenario_project DROP FOREIGN KEY FK_307510EE78907A47');
$this->addSql('DROP TABLE nda_file');
$this->addSql('DROP TABLE resources_ndafile_signatory');
$this->addSql('ALTER TABLE resource CHANGE isAgent isAgent TINYINT(1) DEFAULT 0');
$this->addSql('DROP INDEX IDX_307510EE78907A47 ON scenario_project');
$this->addSql('ALTER TABLE scenario_project DROP nda_file_id, CHANGE max_scenario_duration max_scenario_duration NUMERIC(10, 2) DEFAULT \'0.00\' NOT NULL');
}
}