<?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 Version20220319143809 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 address (id INT AUTO_INCREMENT NOT NULL, street VARCHAR(255) DEFAULT NULL, zip_code VARCHAR(255) DEFAULT NULL, city VARCHAR(255) DEFAULT NULL, latitude DOUBLE PRECISION DEFAULT NULL, longitude DOUBLE PRECISION 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 company_criteria (id INT AUTO_INCREMENT NOT NULL, photo_id INT DEFAULT NULL, text LONGTEXT DEFAULT NULL, created_at DATETIME NOT NULL COMMENT \'(DC2Type:datetime_immutable)\', updated_at DATETIME NOT NULL COMMENT \'(DC2Type:datetime_immutable)\', UNIQUE INDEX UNIQ_AE888EEC7E9E4C8C (photo_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB');
$this->addSql('CREATE TABLE company_site (id INT AUTO_INCREMENT NOT NULL, address_id INT DEFAULT NULL, office_criteria_id INT DEFAULT NULL, around_criteria_id INT DEFAULT NULL, company_id INT NOT NULL, created_at DATETIME NOT NULL COMMENT \'(DC2Type:datetime_immutable)\', updated_at DATETIME NOT NULL COMMENT \'(DC2Type:datetime_immutable)\', UNIQUE INDEX UNIQ_2A2E130AF5B7AF75 (address_id), UNIQUE INDEX UNIQ_2A2E130AA3E1A8A7 (office_criteria_id), UNIQUE INDEX UNIQ_2A2E130A68159537 (around_criteria_id), INDEX IDX_2A2E130A979B1AD6 (company_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB');
$this->addSql('ALTER TABLE company_criteria ADD CONSTRAINT FK_AE888EEC7E9E4C8C FOREIGN KEY (photo_id) REFERENCES document (id)');
$this->addSql('ALTER TABLE company_site ADD CONSTRAINT FK_2A2E130AF5B7AF75 FOREIGN KEY (address_id) REFERENCES address (id)');
$this->addSql('ALTER TABLE company_site ADD CONSTRAINT FK_2A2E130AA3E1A8A7 FOREIGN KEY (office_criteria_id) REFERENCES company_criteria (id)');
$this->addSql('ALTER TABLE company_site ADD CONSTRAINT FK_2A2E130A68159537 FOREIGN KEY (around_criteria_id) REFERENCES company_criteria (id)');
$this->addSql('ALTER TABLE company_site ADD CONSTRAINT FK_2A2E130A979B1AD6 FOREIGN KEY (company_id) REFERENCES company_profile (id)');
$this->addSql('ALTER TABLE company_profile ADD history_id INT DEFAULT NULL, ADD activity_id INT DEFAULT NULL, ADD spirit_id INT DEFAULT NULL, ADD lifestyle_id INT DEFAULT NULL, ADD few_words_id INT DEFAULT NULL');
$this->addSql('ALTER TABLE company_profile ADD CONSTRAINT FK_A105B0D81E058452 FOREIGN KEY (history_id) REFERENCES company_criteria (id)');
$this->addSql('ALTER TABLE company_profile ADD CONSTRAINT FK_A105B0D881C06096 FOREIGN KEY (activity_id) REFERENCES company_criteria (id)');
$this->addSql('ALTER TABLE company_profile ADD CONSTRAINT FK_A105B0D832CCE107 FOREIGN KEY (spirit_id) REFERENCES company_criteria (id)');
$this->addSql('ALTER TABLE company_profile ADD CONSTRAINT FK_A105B0D868F6409A FOREIGN KEY (lifestyle_id) REFERENCES company_criteria (id)');
$this->addSql('ALTER TABLE company_profile ADD CONSTRAINT FK_A105B0D835FEEF29 FOREIGN KEY (few_words_id) REFERENCES company_criteria (id)');
$this->addSql('CREATE UNIQUE INDEX UNIQ_A105B0D81E058452 ON company_profile (history_id)');
$this->addSql('CREATE UNIQUE INDEX UNIQ_A105B0D881C06096 ON company_profile (activity_id)');
$this->addSql('CREATE UNIQUE INDEX UNIQ_A105B0D832CCE107 ON company_profile (spirit_id)');
$this->addSql('CREATE UNIQUE INDEX UNIQ_A105B0D868F6409A ON company_profile (lifestyle_id)');
$this->addSql('CREATE UNIQUE INDEX UNIQ_A105B0D835FEEF29 ON company_profile (few_words_id)');
}
public function down(Schema $schema): void
{
// this down() migration is auto-generated, please modify it to your needs
$this->addSql('ALTER TABLE company_site DROP FOREIGN KEY FK_2A2E130AF5B7AF75');
$this->addSql('ALTER TABLE company_profile DROP FOREIGN KEY FK_A105B0D81E058452');
$this->addSql('ALTER TABLE company_profile DROP FOREIGN KEY FK_A105B0D881C06096');
$this->addSql('ALTER TABLE company_profile DROP FOREIGN KEY FK_A105B0D832CCE107');
$this->addSql('ALTER TABLE company_profile DROP FOREIGN KEY FK_A105B0D868F6409A');
$this->addSql('ALTER TABLE company_profile DROP FOREIGN KEY FK_A105B0D835FEEF29');
$this->addSql('ALTER TABLE company_site DROP FOREIGN KEY FK_2A2E130AA3E1A8A7');
$this->addSql('ALTER TABLE company_site DROP FOREIGN KEY FK_2A2E130A68159537');
$this->addSql('DROP TABLE address');
$this->addSql('DROP TABLE company_criteria');
$this->addSql('DROP TABLE company_site');
$this->addSql('ALTER TABLE blog_article CHANGE status status VARCHAR(255) NOT NULL COLLATE `utf8mb4_unicode_ci`, CHANGE type type VARCHAR(255) NOT NULL COLLATE `utf8mb4_unicode_ci`, CHANGE link link VARCHAR(255) DEFAULT NULL COLLATE `utf8mb4_unicode_ci`, CHANGE title title VARCHAR(255) NOT NULL COLLATE `utf8mb4_unicode_ci`, CHANGE excerpt excerpt LONGTEXT DEFAULT NULL COLLATE `utf8mb4_unicode_ci`, CHANGE featured_media featured_media VARCHAR(255) DEFAULT NULL COLLATE `utf8mb4_unicode_ci`');
$this->addSql('ALTER TABLE blog_category CHANGE name name VARCHAR(255) NOT NULL COLLATE `utf8mb4_unicode_ci`, CHANGE link link VARCHAR(255) NOT NULL COLLATE `utf8mb4_unicode_ci`');
$this->addSql('ALTER TABLE blog_tag CHANGE name name VARCHAR(255) NOT NULL COLLATE `utf8mb4_unicode_ci`, CHANGE link link VARCHAR(255) DEFAULT NULL COLLATE `utf8mb4_unicode_ci`, CHANGE slug slug VARCHAR(255) NOT NULL COLLATE `utf8mb4_unicode_ci`');
$this->addSql('ALTER TABLE branch_activity CHANGE label label VARCHAR(255) NOT NULL COLLATE `utf8mb4_unicode_ci`');
$this->addSql('ALTER TABLE capacity CHANGE label label VARCHAR(255) NOT NULL COLLATE `utf8mb4_unicode_ci`');
$this->addSql('ALTER TABLE city CHANGE name name VARCHAR(255) NOT NULL COLLATE `utf8mb4_unicode_ci`, CHANGE zip_code zip_code VARCHAR(15) NOT NULL COLLATE `utf8mb4_unicode_ci`, CHANGE slug slug VARCHAR(255) NOT NULL COLLATE `utf8mb4_unicode_ci`');
$this->addSql('ALTER TABLE city_type CHANGE label label VARCHAR(255) NOT NULL COLLATE `utf8mb4_unicode_ci`');
$this->addSql('ALTER TABLE civility CHANGE label label VARCHAR(255) NOT NULL COLLATE `utf8mb4_unicode_ci`');
$this->addSql('DROP INDEX UNIQ_A105B0D81E058452 ON company_profile');
$this->addSql('DROP INDEX UNIQ_A105B0D881C06096 ON company_profile');
$this->addSql('DROP INDEX UNIQ_A105B0D832CCE107 ON company_profile');
$this->addSql('DROP INDEX UNIQ_A105B0D868F6409A ON company_profile');
$this->addSql('DROP INDEX UNIQ_A105B0D835FEEF29 ON company_profile');
$this->addSql('ALTER TABLE company_profile DROP history_id, DROP activity_id, DROP spirit_id, DROP lifestyle_id, DROP few_words_id, CHANGE name name VARCHAR(255) NOT NULL COLLATE `utf8mb4_unicode_ci`, CHANGE website website VARCHAR(255) DEFAULT NULL COLLATE `utf8mb4_unicode_ci`, CHANGE overview overview LONGTEXT DEFAULT NULL COLLATE `utf8mb4_unicode_ci`, CHANGE about about LONGTEXT DEFAULT NULL COLLATE `utf8mb4_unicode_ci`');
$this->addSql('ALTER TABLE contact_reason CHANGE label label VARCHAR(255) NOT NULL COLLATE `utf8mb4_unicode_ci`');
$this->addSql('ALTER TABLE department CHANGE code code VARCHAR(255) NOT NULL COLLATE `utf8mb4_unicode_ci`, CHANGE name name VARCHAR(255) NOT NULL COLLATE `utf8mb4_unicode_ci`, CHANGE slug slug VARCHAR(255) NOT NULL COLLATE `utf8mb4_unicode_ci`');
$this->addSql('ALTER TABLE departure_reason CHANGE label label VARCHAR(255) NOT NULL COLLATE `utf8mb4_unicode_ci`');
$this->addSql('ALTER TABLE document CHANGE file_name file_name VARCHAR(255) DEFAULT NULL COLLATE `utf8mb4_unicode_ci`, CHANGE hash hash VARCHAR(255) DEFAULT NULL COLLATE `utf8mb4_unicode_ci`');
$this->addSql('ALTER TABLE health_exercise_mode CHANGE label label VARCHAR(255) NOT NULL COLLATE `utf8mb4_unicode_ci`');
$this->addSql('ALTER TABLE health_speciality CHANGE label label VARCHAR(255) NOT NULL COLLATE `utf8mb4_unicode_ci`');
$this->addSql('ALTER TABLE icon CHANGE label label VARCHAR(50) NOT NULL COLLATE `utf8mb4_unicode_ci`');
$this->addSql('ALTER TABLE job_advantage CHANGE label label VARCHAR(255) NOT NULL COLLATE `utf8mb4_unicode_ci`');
$this->addSql('ALTER TABLE job_level CHANGE label label VARCHAR(255) NOT NULL COLLATE `utf8mb4_unicode_ci`');
$this->addSql('ALTER TABLE job_offer CHANGE title title VARCHAR(255) NOT NULL COLLATE `utf8mb4_unicode_ci`, CHANGE start_date start_date VARCHAR(255) DEFAULT NULL COLLATE `utf8mb4_unicode_ci`, CHANGE salary salary VARCHAR(255) DEFAULT NULL COLLATE `utf8mb4_unicode_ci`, CHANGE description description LONGTEXT DEFAULT NULL COLLATE `utf8mb4_unicode_ci`');
$this->addSql('ALTER TABLE job_type CHANGE label label VARCHAR(255) NOT NULL COLLATE `utf8mb4_unicode_ci`');
$this->addSql('ALTER TABLE last_update_process CHANGE process process VARCHAR(255) NOT NULL COLLATE `utf8mb4_unicode_ci`');
$this->addSql('ALTER TABLE living_environment CHANGE label label VARCHAR(255) NOT NULL COLLATE `utf8mb4_unicode_ci`');
$this->addSql('ALTER TABLE notification CHANGE message message VARCHAR(255) NOT NULL COLLATE `utf8mb4_unicode_ci`, CHANGE icon icon VARCHAR(255) DEFAULT NULL COLLATE `utf8mb4_unicode_ci`, CHANGE color color VARCHAR(255) DEFAULT NULL COLLATE `utf8mb4_unicode_ci`, CHANGE path path VARCHAR(255) NOT NULL COLLATE `utf8mb4_unicode_ci`, CHANGE params params LONGTEXT DEFAULT NULL COLLATE `utf8mb4_unicode_ci` COMMENT \'(DC2Type:array)\'');
$this->addSql('ALTER TABLE person CHANGE last_name last_name VARCHAR(255) DEFAULT NULL COLLATE `utf8mb4_unicode_ci`, CHANGE first_name first_name VARCHAR(255) DEFAULT NULL COLLATE `utf8mb4_unicode_ci`, CHANGE email email VARCHAR(255) DEFAULT NULL COLLATE `utf8mb4_unicode_ci`, CHANGE phone phone VARCHAR(255) DEFAULT NULL COLLATE `utf8mb4_unicode_ci`, CHANGE civility civility VARCHAR(255) DEFAULT NULL COLLATE `utf8mb4_unicode_ci`');
$this->addSql('ALTER TABLE professional_profile CHANGE linkedin linkedin VARCHAR(255) DEFAULT NULL COLLATE `utf8mb4_unicode_ci`, CHANGE experience experience VARCHAR(255) DEFAULT NULL COLLATE `utf8mb4_unicode_ci`, CHANGE family_situation family_situation VARCHAR(255) DEFAULT NULL COLLATE `utf8mb4_unicode_ci`, CHANGE time_to_leave time_to_leave VARCHAR(255) DEFAULT NULL COLLATE `utf8mb4_unicode_ci`, CHANGE other_branche other_branche VARCHAR(255) DEFAULT NULL COLLATE `utf8mb4_unicode_ci`, CHANGE other_search_capacity other_search_capacity VARCHAR(255) DEFAULT NULL COLLATE `utf8mb4_unicode_ci`, CHANGE other_type_research other_type_research VARCHAR(255) DEFAULT NULL COLLATE `utf8mb4_unicode_ci`, CHANGE other_project_situation_status other_project_situation_status VARCHAR(255) DEFAULT NULL COLLATE `utf8mb4_unicode_ci`, CHANGE other_professional_type other_professional_type VARCHAR(255) DEFAULT NULL COLLATE `utf8mb4_unicode_ci`, CHANGE other_health_speciality other_health_speciality VARCHAR(255) DEFAULT NULL COLLATE `utf8mb4_unicode_ci`, CHANGE about about LONGTEXT DEFAULT NULL COLLATE `utf8mb4_unicode_ci`');
$this->addSql('ALTER TABLE professional_profile_contact CHANGE message message LONGTEXT DEFAULT NULL COLLATE `utf8mb4_unicode_ci`');
$this->addSql('ALTER TABLE professional_type CHANGE label label VARCHAR(255) NOT NULL COLLATE `utf8mb4_unicode_ci`');
$this->addSql('ALTER TABLE project_leader CHANGE description description LONGTEXT DEFAULT NULL COLLATE `utf8mb4_unicode_ci`, CHANGE other_type other_type VARCHAR(255) DEFAULT NULL COLLATE `utf8mb4_unicode_ci`');
$this->addSql('ALTER TABLE project_leader_type CHANGE label label VARCHAR(255) NOT NULL COLLATE `utf8mb4_unicode_ci`');
$this->addSql('ALTER TABLE project_situation_status CHANGE label label VARCHAR(255) NOT NULL COLLATE `utf8mb4_unicode_ci`');
$this->addSql('ALTER TABLE region CHANGE code code VARCHAR(3) NOT NULL COLLATE `utf8mb4_unicode_ci`, CHANGE name name VARCHAR(255) NOT NULL COLLATE `utf8mb4_unicode_ci`, CHANGE slug slug VARCHAR(255) NOT NULL COLLATE `utf8mb4_unicode_ci`');
$this->addSql('ALTER TABLE reset_password_request CHANGE selector selector VARCHAR(20) NOT NULL COLLATE `utf8mb4_unicode_ci`, CHANGE hashed_token hashed_token VARCHAR(100) NOT NULL COLLATE `utf8mb4_unicode_ci`');
$this->addSql('ALTER TABLE socio_professional_category CHANGE label label VARCHAR(255) NOT NULL COLLATE `utf8mb4_unicode_ci`');
$this->addSql('ALTER TABLE territory CHANGE name name VARCHAR(255) NOT NULL COLLATE `utf8mb4_unicode_ci`, CHANGE type type VARCHAR(255) NOT NULL COLLATE `utf8mb4_unicode_ci`');
$this->addSql('ALTER TABLE territory_feature CHANGE label label VARCHAR(255) NOT NULL COLLATE `utf8mb4_unicode_ci`');
$this->addSql('ALTER TABLE type_research CHANGE label label VARCHAR(255) NOT NULL COLLATE `utf8mb4_unicode_ci`');
$this->addSql('ALTER TABLE user CHANGE email email VARCHAR(180) NOT NULL COLLATE `utf8mb4_unicode_ci`, CHANGE password password VARCHAR(255) NOT NULL COLLATE `utf8mb4_unicode_ci`, CHANGE token token VARCHAR(255) DEFAULT NULL COLLATE `utf8mb4_unicode_ci`');
}
}