migrations/Version20230622132326.php line 1

Open in your IDE?
  1. <?php
  2. declare(strict_types=1);
  3. namespace DoctrineMigrations;
  4. use Doctrine\DBAL\Schema\Schema;
  5. use Doctrine\Migrations\AbstractMigration;
  6. /**
  7.  * Auto-generated Migration: Please modify to your needs!
  8.  */
  9. final class Version20230622132326 extends AbstractMigration
  10. {
  11.     public function getDescription(): string
  12.     {
  13.         return '';
  14.     }
  15.     public function up(Schema $schema): void
  16.     {
  17.         // this up() migration is auto-generated, please modify it to your needs
  18.         $this->addSql('CREATE TABLE depot_dossier (id INT AUTO_INCREMENT NOT NULL, deal_id INT DEFAULT NULL, clientfiscale VARCHAR(255) DEFAULT NULL, nomclient VARCHAR(255) DEFAULT NULL, prenomclient VARCHAR(255) DEFAULT NULL, adresse VARCHAR(255) DEFAULT NULL, ville VARCHAR(255) DEFAULT NULL, codepostale VARCHAR(255) DEFAULT NULL, civilite VARCHAR(255) DEFAULT NULL, phone VARCHAR(255) DEFAULT NULL, email VARCHAR(255) DEFAULT NULL, natureoccupation VARCHAR(255) DEFAULT NULL, typelogement VARCHAR(255) DEFAULT NULL, energiechauffage VARCHAR(255) DEFAULT NULL, anciennete VARCHAR(255) DEFAULT NULL, systemechauffage VARCHAR(255) DEFAULT NULL, surfacehabitable VARCHAR(255) DEFAULT NULL, superficiesol VARCHAR(255) DEFAULT NULL, parcellecadastrale VARCHAR(255) DEFAULT NULL, typemaison VARCHAR(255) DEFAULT NULL, soussol VARCHAR(255) DEFAULT NULL, anciennetelogement VARCHAR(255) DEFAULT NULL, INDEX IDX_2E6CACA6F60E2305 (deal_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB');
  19.         $this->addSql('CREATE TABLE depot_dossier_operation_standard (depot_dossier_id INT NOT NULL, operation_standard_id INT NOT NULL, INDEX IDX_4A9ADFA1FD023A5A (depot_dossier_id), INDEX IDX_4A9ADFA197B7C544 (operation_standard_id), PRIMARY KEY(depot_dossier_id, operation_standard_id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB');
  20.         $this->addSql('ALTER TABLE depot_dossier ADD CONSTRAINT FK_2E6CACA6F60E2305 FOREIGN KEY (deal_id) REFERENCES deal (id)');
  21.         $this->addSql('ALTER TABLE depot_dossier_operation_standard ADD CONSTRAINT FK_4A9ADFA1FD023A5A FOREIGN KEY (depot_dossier_id) REFERENCES depot_dossier (id) ON DELETE CASCADE');
  22.         $this->addSql('ALTER TABLE depot_dossier_operation_standard ADD CONSTRAINT FK_4A9ADFA197B7C544 FOREIGN KEY (operation_standard_id) REFERENCES operation_standard (id) ON DELETE CASCADE');
  23.     }
  24.     public function down(Schema $schema): void
  25.     {
  26.         // this down() migration is auto-generated, please modify it to your needs
  27.         $this->addSql('ALTER TABLE depot_dossier_operation_standard DROP FOREIGN KEY FK_4A9ADFA1FD023A5A');
  28.         $this->addSql('DROP TABLE depot_dossier');
  29.         $this->addSql('DROP TABLE depot_dossier_operation_standard');
  30.     }
  31. }