<?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 Version20211024224048 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 branch_activity (id INT AUTO_INCREMENT NOT NULL, label VARCHAR(255) NOT NULL, created_at DATETIME NOT NULL COMMENT \'(DC2Type:datetime_immutable)\', updated_at DATETIME NOT NULL COMMENT \'(DC2Type:datetime_immutable)\', PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB');
$this->addSql('CREATE TABLE capacity (id INT AUTO_INCREMENT NOT NULL, label VARCHAR(255) NOT NULL, created_at DATETIME NOT NULL COMMENT \'(DC2Type:datetime_immutable)\', updated_at DATETIME NOT NULL COMMENT \'(DC2Type:datetime_immutable)\', PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB');
$this->addSql('CREATE TABLE contact_reason (id INT AUTO_INCREMENT NOT NULL, label VARCHAR(255) NOT NULL, created_at DATETIME NOT NULL COMMENT \'(DC2Type:datetime_immutable)\', updated_at DATETIME NOT NULL COMMENT \'(DC2Type:datetime_immutable)\', PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB');
$this->addSql('CREATE TABLE health_speciality (id INT AUTO_INCREMENT NOT NULL, health_speciality VARCHAR(255) NOT NULL, created_at DATETIME NOT NULL COMMENT \'(DC2Type:datetime_immutable)\', updated_at DATETIME NOT NULL COMMENT \'(DC2Type:datetime_immutable)\', PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB');
$this->addSql('CREATE TABLE living_environment (id INT AUTO_INCREMENT NOT NULL, label VARCHAR(255) NOT NULL, created_at DATETIME NOT NULL COMMENT \'(DC2Type:datetime_immutable)\', updated_at DATETIME NOT NULL COMMENT \'(DC2Type:datetime_immutable)\', PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB');
$this->addSql('CREATE TABLE person (id INT AUTO_INCREMENT NOT NULL, last_name VARCHAR(255) DEFAULT NULL, first_name VARCHAR(255) NOT NULL, email VARCHAR(255) DEFAULT NULL, birthdate DATE NOT NULL, phone VARCHAR(255) DEFAULT NULL, created_at DATETIME NOT NULL COMMENT \'(DC2Type:datetime_immutable)\', updated_at DATETIME NOT NULL COMMENT \'(DC2Type:datetime_immutable)\', PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB');
$this->addSql('CREATE TABLE professional_profile (id INT AUTO_INCREMENT NOT NULL, socio_category_id INT NOT NULL, health_speciality_id INT DEFAULT NULL, project_leader_id INT DEFAULT NULL, linkedin VARCHAR(255) NOT NULL, experience VARCHAR(255) DEFAULT NULL, family_situation VARCHAR(255) DEFAULT NULL, time_to_leave VARCHAR(255) DEFAULT NULL, INDEX IDX_E728A82260F371C (socio_category_id), INDEX IDX_E728A82C539AC8E (health_speciality_id), UNIQUE INDEX UNIQ_E728A8262290B03 (project_leader_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB');
$this->addSql('CREATE TABLE professional_profile_branch_activity (professional_profile_id INT NOT NULL, branch_activity_id INT NOT NULL, INDEX IDX_353E0917FB976A01 (professional_profile_id), INDEX IDX_353E0917D0CC46C (branch_activity_id), PRIMARY KEY(professional_profile_id, branch_activity_id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB');
$this->addSql('CREATE TABLE professional_profile_capacity (professional_profile_id INT NOT NULL, capacity_id INT NOT NULL, INDEX IDX_508DE5BDFB976A01 (professional_profile_id), INDEX IDX_508DE5BD66B6F0BA (capacity_id), PRIMARY KEY(professional_profile_id, capacity_id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB');
$this->addSql('CREATE TABLE professional_profile_project_situation_status (professional_profile_id INT NOT NULL, project_situation_status_id INT NOT NULL, INDEX IDX_5E0B98BCFB976A01 (professional_profile_id), INDEX IDX_5E0B98BC8A3D4FBC (project_situation_status_id), PRIMARY KEY(professional_profile_id, project_situation_status_id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB');
$this->addSql('CREATE TABLE professional_type (id INT AUTO_INCREMENT NOT NULL, label VARCHAR(255) NOT NULL, created_at DATETIME NOT NULL COMMENT \'(DC2Type:datetime_immutable)\', updated_at DATETIME NOT NULL COMMENT \'(DC2Type:datetime_immutable)\', PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB');
$this->addSql('CREATE TABLE project_leader (id INT AUTO_INCREMENT NOT NULL, type_id INT DEFAULT NULL, branch_id INT DEFAULT NULL, description LONGTEXT DEFAULT NULL, created_at DATETIME NOT NULL COMMENT \'(DC2Type:datetime_immutable)\', updated_at DATETIME NOT NULL COMMENT \'(DC2Type:datetime_immutable)\', INDEX IDX_E247019DC54C8C93 (type_id), INDEX IDX_E247019DDCD6CC49 (branch_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB');
$this->addSql('CREATE TABLE project_leader_type (id INT AUTO_INCREMENT NOT NULL, label VARCHAR(255) NOT NULL, created_at DATETIME NOT NULL COMMENT \'(DC2Type:datetime_immutable)\', updated_at DATETIME NOT NULL COMMENT \'(DC2Type:datetime_immutable)\', PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB');
$this->addSql('CREATE TABLE project_situation_status (id INT AUTO_INCREMENT NOT NULL, label VARCHAR(255) NOT NULL, created_at DATETIME NOT NULL COMMENT \'(DC2Type:datetime_immutable)\', updated_at DATETIME NOT NULL COMMENT \'(DC2Type:datetime_immutable)\', PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB');
$this->addSql('CREATE TABLE socio_professional_category (id INT AUTO_INCREMENT NOT NULL, label VARCHAR(255) NOT NULL, created_at DATETIME NOT NULL COMMENT \'(DC2Type:datetime_immutable)\', updated_at DATETIME NOT NULL COMMENT \'(DC2Type:datetime_immutable)\', PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB');
$this->addSql('ALTER TABLE professional_profile ADD CONSTRAINT FK_E728A82260F371C FOREIGN KEY (socio_category_id) REFERENCES socio_professional_category (id)');
$this->addSql('ALTER TABLE professional_profile ADD CONSTRAINT FK_E728A82C539AC8E FOREIGN KEY (health_speciality_id) REFERENCES health_speciality (id)');
$this->addSql('ALTER TABLE professional_profile ADD CONSTRAINT FK_E728A8262290B03 FOREIGN KEY (project_leader_id) REFERENCES project_leader (id)');
$this->addSql('ALTER TABLE professional_profile_branch_activity ADD CONSTRAINT FK_353E0917FB976A01 FOREIGN KEY (professional_profile_id) REFERENCES professional_profile (id) ON DELETE CASCADE');
$this->addSql('ALTER TABLE professional_profile_branch_activity ADD CONSTRAINT FK_353E0917D0CC46C FOREIGN KEY (branch_activity_id) REFERENCES branch_activity (id) ON DELETE CASCADE');
$this->addSql('ALTER TABLE professional_profile_capacity ADD CONSTRAINT FK_508DE5BDFB976A01 FOREIGN KEY (professional_profile_id) REFERENCES professional_profile (id) ON DELETE CASCADE');
$this->addSql('ALTER TABLE professional_profile_capacity ADD CONSTRAINT FK_508DE5BD66B6F0BA FOREIGN KEY (capacity_id) REFERENCES capacity (id) ON DELETE CASCADE');
$this->addSql('ALTER TABLE professional_profile_project_situation_status ADD CONSTRAINT FK_5E0B98BCFB976A01 FOREIGN KEY (professional_profile_id) REFERENCES professional_profile (id) ON DELETE CASCADE');
$this->addSql('ALTER TABLE professional_profile_project_situation_status ADD CONSTRAINT FK_5E0B98BC8A3D4FBC FOREIGN KEY (project_situation_status_id) REFERENCES project_situation_status (id) ON DELETE CASCADE');
$this->addSql('ALTER TABLE project_leader ADD CONSTRAINT FK_E247019DC54C8C93 FOREIGN KEY (type_id) REFERENCES project_leader_type (id)');
$this->addSql('ALTER TABLE project_leader ADD CONSTRAINT FK_E247019DDCD6CC49 FOREIGN KEY (branch_id) REFERENCES branch_activity (id)');
}
public function down(Schema $schema): void
{
// this down() migration is auto-generated, please modify it to your needs
$this->addSql('ALTER TABLE professional_profile_branch_activity DROP FOREIGN KEY FK_353E0917D0CC46C');
$this->addSql('ALTER TABLE project_leader DROP FOREIGN KEY FK_E247019DDCD6CC49');
$this->addSql('ALTER TABLE professional_profile_capacity DROP FOREIGN KEY FK_508DE5BD66B6F0BA');
$this->addSql('ALTER TABLE professional_profile DROP FOREIGN KEY FK_E728A82C539AC8E');
$this->addSql('ALTER TABLE professional_profile_branch_activity DROP FOREIGN KEY FK_353E0917FB976A01');
$this->addSql('ALTER TABLE professional_profile_capacity DROP FOREIGN KEY FK_508DE5BDFB976A01');
$this->addSql('ALTER TABLE professional_profile_project_situation_status DROP FOREIGN KEY FK_5E0B98BCFB976A01');
$this->addSql('ALTER TABLE professional_profile DROP FOREIGN KEY FK_E728A8262290B03');
$this->addSql('ALTER TABLE project_leader DROP FOREIGN KEY FK_E247019DC54C8C93');
$this->addSql('ALTER TABLE professional_profile_project_situation_status DROP FOREIGN KEY FK_5E0B98BC8A3D4FBC');
$this->addSql('ALTER TABLE professional_profile DROP FOREIGN KEY FK_E728A82260F371C');
$this->addSql('DROP TABLE branch_activity');
$this->addSql('DROP TABLE capacity');
$this->addSql('DROP TABLE contact_reason');
$this->addSql('DROP TABLE health_speciality');
$this->addSql('DROP TABLE living_environment');
$this->addSql('DROP TABLE person');
$this->addSql('DROP TABLE professional_profile');
$this->addSql('DROP TABLE professional_profile_branch_activity');
$this->addSql('DROP TABLE professional_profile_capacity');
$this->addSql('DROP TABLE professional_profile_project_situation_status');
$this->addSql('DROP TABLE professional_type');
$this->addSql('DROP TABLE project_leader');
$this->addSql('DROP TABLE project_leader_type');
$this->addSql('DROP TABLE project_situation_status');
$this->addSql('DROP TABLE socio_professional_category');
}
}