migrations/Version20220409130648.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 Version20220409130648 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 (id INT AUTO_INCREMENT NOT 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 NOT NULL, PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB');
  19.         $this->addSql('CREATE TABLE courtier (id INT AUTO_INCREMENT NOT NULL, nom_cabinet VARCHAR(255) DEFAULT NULL, code_courtier VARCHAR(100) NOT NULL, is_sur_commission TINYINT(1) DEFAULT NULL, valeur_commission INT DEFAULT NULL, log_valeur_commission LONGTEXT DEFAULT NULL, etat INT NOT NULL, created_at DATETIME NOT NULL, updated_at DATETIME DEFAULT NULL, PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB');
  20.         $this->addSql('CREATE TABLE garanties (id INT AUTO_INCREMENT NOT NULL, contrat_id INT DEFAULT NULL, produit INT NOT NULL, frais_versement INT 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_2ECAF4371823061F (contrat_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB');
  21.         $this->addSql('CREATE TABLE souscripteur (id INT AUTO_INCREMENT NOT NULL, type INT NOT NULL, raison_sociale VARCHAR(255) DEFAULT NULL, siret VARCHAR(13) DEFAULT NULL, nom VARCHAR(100) DEFAULT NULL, prenom VARCHAR(100) DEFAULT NULL, date_naissance DATETIME DEFAULT NULL, created_at DATETIME NOT NULL, updated_at DATETIME DEFAULT NULL, etat INT DEFAULT NULL, PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB');
  22.         $this->addSql('ALTER TABLE garanties ADD CONSTRAINT FK_2ECAF4371823061F FOREIGN KEY (contrat_id) REFERENCES contrat (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('ALTER TABLE garanties DROP FOREIGN KEY FK_2ECAF4371823061F');
  28.         $this->addSql('DROP TABLE contrat');
  29.         $this->addSql('DROP TABLE courtier');
  30.         $this->addSql('DROP TABLE garanties');
  31.         $this->addSql('DROP TABLE souscripteur');
  32.     }
  33. }