migrations/Version20220409213143.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 Version20220409213143 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 dossier_retraite (id INT AUTO_INCREMENT NOT NULL, courtier_id INT DEFAULT NULL, souscripteur_id INT DEFAULT NULL, contrat_id INT DEFAULT NULL, garantie_id INT DEFAULT NULL, etat INT NOT NULL, created_at DATETIME NOT NULL, updated_at DATETIME DEFAULT NULL, INDEX IDX_DB2F7D25E82428FD (courtier_id), INDEX IDX_DB2F7D25A0B466D6 (souscripteur_id), INDEX IDX_DB2F7D251823061F (contrat_id), INDEX IDX_DB2F7D25A4B9602F (garantie_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB');
  19.         $this->addSql('ALTER TABLE dossier_retraite ADD CONSTRAINT FK_DB2F7D25E82428FD FOREIGN KEY (courtier_id) REFERENCES courtier (id)');
  20.         $this->addSql('ALTER TABLE dossier_retraite ADD CONSTRAINT FK_DB2F7D25A0B466D6 FOREIGN KEY (souscripteur_id) REFERENCES souscripteur (id)');
  21.         $this->addSql('ALTER TABLE dossier_retraite ADD CONSTRAINT FK_DB2F7D251823061F FOREIGN KEY (contrat_id) REFERENCES contrat (id)');
  22.         $this->addSql('ALTER TABLE dossier_retraite ADD CONSTRAINT FK_DB2F7D25A4B9602F FOREIGN KEY (garantie_id) REFERENCES garanties (id)');
  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('DROP TABLE dossier_retraite');
  28.     }
  29. }