<?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 Version20220208084703 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 candidature (id INT AUTO_INCREMENT NOT NULL, user_id INT DEFAULT NULL, offer_id INT DEFAULT NULL, cv VARCHAR(255) NOT NULL, lettre_motivation VARCHAR(255) NOT NULL, commentaire LONGTEXT DEFAULT NULL, INDEX IDX_E33BD3B8A76ED395 (user_id), INDEX IDX_E33BD3B853C674EE (offer_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB');
$this->addSql('ALTER TABLE candidature ADD CONSTRAINT FK_E33BD3B8A76ED395 FOREIGN KEY (user_id) REFERENCES `user` (id)');
$this->addSql('ALTER TABLE candidature ADD CONSTRAINT FK_E33BD3B853C674EE FOREIGN KEY (offer_id) REFERENCES offer (id)');
$this->addSql('DROP TABLE upload');
$this->addSql('ALTER TABLE offer ADD id_user INT DEFAULT NULL, ADD localisation VARCHAR(255) DEFAULT NULL, ADD nom_structure VARCHAR(255) DEFAULT NULL, ADD description_structure LONGTEXT DEFAULT NULL, CHANGE titre titre VARCHAR(255) DEFAULT NULL, CHANGE intitule_poste intitule_poste VARCHAR(255) DEFAULT NULL, CHANGE description_poste description_poste VARCHAR(255) DEFAULT NULL, CHANGE missions missions VARCHAR(255) DEFAULT NULL, CHANGE experience experience VARCHAR(255) DEFAULT NULL, CHANGE convention_collective convention_collective VARCHAR(255) DEFAULT NULL, CHANGE temps_travail temps_travail VARCHAR(255) DEFAULT NULL, CHANGE date_debut_contrat date_debut_contrat DATE DEFAULT NULL, CHANGE date_entretien date_entretien DATE DEFAULT NULL, CHANGE date_publication date_publication DATE DEFAULT NULL, CHANGE type_contrat type_contrat VARCHAR(255) DEFAULT NULL, CHANGE categorie_contrat categorie_contrat VARCHAR(255) DEFAULT NULL, CHANGE name_file name_pdf VARCHAR(255) DEFAULT NULL');
$this->addSql('ALTER TABLE offer ADD CONSTRAINT FK_29D6873E6B3CA4B FOREIGN KEY (id_user) REFERENCES `user` (id)');
$this->addSql('CREATE INDEX IDX_29D6873E6B3CA4B ON offer (id_user)');
$this->addSql('ALTER TABLE user DROP logo_structure');
}
public function down(Schema $schema): void
{
// this down() migration is auto-generated, please modify it to your needs
$this->addSql('CREATE TABLE upload (id INT AUTO_INCREMENT NOT NULL, namepdf VARCHAR(255) CHARACTER SET utf8mb4 DEFAULT NULL COLLATE `utf8mb4_unicode_ci`, titre VARCHAR(255) CHARACTER SET utf8mb4 DEFAULT NULL COLLATE `utf8mb4_unicode_ci`, nom_structure VARCHAR(255) CHARACTER SET utf8mb4 DEFAULT NULL COLLATE `utf8mb4_unicode_ci`, description_structure VARCHAR(255) CHARACTER SET utf8mb4 DEFAULT NULL COLLATE `utf8mb4_unicode_ci`, intitule_poste VARCHAR(255) CHARACTER SET utf8mb4 DEFAULT NULL COLLATE `utf8mb4_unicode_ci`, description_poste VARCHAR(255) CHARACTER SET utf8mb4 DEFAULT NULL COLLATE `utf8mb4_unicode_ci`, missions VARCHAR(255) CHARACTER SET utf8mb4 DEFAULT NULL COLLATE `utf8mb4_unicode_ci`, statut VARCHAR(255) CHARACTER SET utf8mb4 DEFAULT NULL COLLATE `utf8mb4_unicode_ci`, logo_structure VARCHAR(255) CHARACTER SET utf8mb4 DEFAULT NULL COLLATE `utf8mb4_unicode_ci`, nombre_candidature INT DEFAULT NULL, experience INT DEFAULT NULL, convention_collective VARCHAR(255) CHARACTER SET utf8mb4 DEFAULT NULL COLLATE `utf8mb4_unicode_ci`, outils VARCHAR(255) CHARACTER SET utf8mb4 DEFAULT NULL COLLATE `utf8mb4_unicode_ci`, temps_travail INT DEFAULT NULL, date_debut_contrat DATE DEFAULT NULL, date_entretien DATE DEFAULT NULL, date_publication DATE DEFAULT NULL, date_archivage DATE DEFAULT NULL, salaire INT DEFAULT NULL, formation VARCHAR(255) CHARACTER SET utf8mb4 DEFAULT NULL COLLATE `utf8mb4_unicode_ci`, competences VARCHAR(255) CHARACTER SET utf8mb4 DEFAULT NULL COLLATE `utf8mb4_unicode_ci`, qualites VARCHAR(255) CHARACTER SET utf8mb4 DEFAULT NULL COLLATE `utf8mb4_unicode_ci`, type_contrat VARCHAR(255) CHARACTER SET utf8mb4 DEFAULT NULL COLLATE `utf8mb4_unicode_ci`, categorie_contrat VARCHAR(255) CHARACTER SET utf8mb4 DEFAULT NULL COLLATE `utf8mb4_unicode_ci`, PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB COMMENT = \'\' ');
$this->addSql('DROP TABLE candidature');
$this->addSql('ALTER TABLE offer DROP FOREIGN KEY FK_29D6873E6B3CA4B');
$this->addSql('DROP INDEX IDX_29D6873E6B3CA4B ON offer');
$this->addSql('ALTER TABLE offer ADD name_file VARCHAR(255) CHARACTER SET utf8mb4 DEFAULT NULL COLLATE `utf8mb4_unicode_ci`, DROP id_user, DROP name_pdf, DROP localisation, DROP nom_structure, DROP description_structure, CHANGE titre titre VARCHAR(255) CHARACTER SET utf8mb4 NOT NULL COLLATE `utf8mb4_unicode_ci`, CHANGE intitule_poste intitule_poste VARCHAR(255) CHARACTER SET utf8mb4 NOT NULL COLLATE `utf8mb4_unicode_ci`, CHANGE description_poste description_poste VARCHAR(255) CHARACTER SET utf8mb4 NOT NULL COLLATE `utf8mb4_unicode_ci`, CHANGE missions missions VARCHAR(255) CHARACTER SET utf8mb4 NOT NULL COLLATE `utf8mb4_unicode_ci`, CHANGE experience experience INT NOT NULL, CHANGE convention_collective convention_collective VARCHAR(255) CHARACTER SET utf8mb4 NOT NULL COLLATE `utf8mb4_unicode_ci`, CHANGE temps_travail temps_travail INT NOT NULL, CHANGE date_debut_contrat date_debut_contrat DATE NOT NULL, CHANGE date_entretien date_entretien DATE NOT NULL, CHANGE date_publication date_publication DATE NOT NULL, CHANGE type_contrat type_contrat VARCHAR(255) CHARACTER SET utf8mb4 NOT NULL COLLATE `utf8mb4_unicode_ci`, CHANGE categorie_contrat categorie_contrat VARCHAR(255) CHARACTER SET utf8mb4 NOT NULL COLLATE `utf8mb4_unicode_ci`');
$this->addSql('ALTER TABLE `user` ADD logo_structure INT DEFAULT NULL');
}
}