migrations/Version20220411202335.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 Version20220411202335 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 contrat_retraite (id INT AUTO_INCREMENT NOT NULL, dossier_retraite_id INT DEFAULT NULL, numero_contrat VARCHAR(255) NOT NULL, numero_sous_contrat VARCHAR(255) NOT NULL, date_effet DATETIME NOT NULL, date_radiation_eventuelle DATETIME DEFAULT NULL, type_commission INT NOT NULL, etat INT NOT NULL, created_at DATETIME NOT NULL, updated_at DATETIME DEFAULT NULL, INDEX IDX_4AA0850869877B02 (dossier_retraite_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB');
  19.         $this->addSql('CREATE TABLE garanties_retraite (id INT AUTO_INCREMENT NOT NULL, dossier_retraite_id INT DEFAULT NULL, produit INT NOT NULL, frais_versement DOUBLE PRECISION NOT NULL, is_exoneration TINYINT(1) NOT NULL, is_deces_majore TINYINT(1) NOT NULL, etat INT NOT NULL, created_at DATETIME NOT NULL, updated_at DATETIME DEFAULT NULL, INDEX IDX_B915C91A69877B02 (dossier_retraite_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB');
  20.         $this->addSql('ALTER TABLE contrat_retraite ADD CONSTRAINT FK_4AA0850869877B02 FOREIGN KEY (dossier_retraite_id) REFERENCES dossier_retraite (id)');
  21.         $this->addSql('ALTER TABLE garanties_retraite ADD CONSTRAINT FK_B915C91A69877B02 FOREIGN KEY (dossier_retraite_id) REFERENCES dossier_retraite (id)');
  22.     }
  23.     public function down(Schema $schema): void
  24.     {
  25.         // this down() migration is auto-generated, please modify it to your needs
  26.         $this->addSql('DROP TABLE contrat_retraite');
  27.         $this->addSql('DROP TABLE garanties_retraite');
  28.     }
  29. }