<?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 Version20220127162645 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 composant_amiante (id INT AUTO_INCREMENT NOT NULL, diagnostic_id INT DEFAULT NULL, liste_composant_amiante VARCHAR(250) NOT NULL, famille_composant_amiante VARCHAR(250) NOT NULL, composant_amiante VARCHAR(250) NOT NULL, localisation VARCHAR(250) NOT NULL, etat_conservation VARCHAR(250) NOT NULL, taux_fibre VARCHAR(250) NOT NULL, mesure_obligatoire VARCHAR(250) NOT NULL, INDEX IDX_B5DFD047224CCA91 (diagnostic_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB');
$this->addSql('CREATE TABLE dta_local_non_visite (id INT AUTO_INCREMENT NOT NULL, diagnostic_id INT DEFAULT NULL, local_non_visite VARCHAR(250) NOT NULL, INDEX IDX_4BD298FA224CCA91 (diagnostic_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB');
$this->addSql('ALTER TABLE composant_amiante ADD CONSTRAINT FK_B5DFD047224CCA91 FOREIGN KEY (diagnostic_id) REFERENCES diagnostic_dta (id)');
$this->addSql('ALTER TABLE dta_local_non_visite ADD CONSTRAINT FK_4BD298FA224CCA91 FOREIGN KEY (diagnostic_id) REFERENCES diagnostic_dta (id)');
$this->addSql('ALTER TABLE diagnostic_dta DROP locaux_non_visites, DROP materiaux_amiantes');
}
public function down(Schema $schema): void
{
// this down() migration is auto-generated, please modify it to your needs
$this->addSql('DROP TABLE composant_amiante');
$this->addSql('DROP TABLE dta_local_non_visite');
$this->addSql('ALTER TABLE diagnostic_dta ADD locaux_non_visites LONGTEXT CHARACTER SET utf8mb4 NOT NULL COLLATE `utf8mb4_unicode_ci` COMMENT \'(DC2Type:json)\', ADD materiaux_amiantes LONGTEXT CHARACTER SET utf8mb4 NOT NULL COLLATE `utf8mb4_unicode_ci` COMMENT \'(DC2Type:json)\'');
}
}