<?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 Version20220409130648 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 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');
$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');
$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');
$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');
$this->addSql('ALTER TABLE garanties ADD CONSTRAINT FK_2ECAF4371823061F FOREIGN KEY (contrat_id) REFERENCES contrat (id)');
}
public function down(Schema $schema): void
{
// this down() migration is auto-generated, please modify it to your needs
$this->addSql('ALTER TABLE garanties DROP FOREIGN KEY FK_2ECAF4371823061F');
$this->addSql('DROP TABLE contrat');
$this->addSql('DROP TABLE courtier');
$this->addSql('DROP TABLE garanties');
$this->addSql('DROP TABLE souscripteur');
}
}