<?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 Version20211101144015 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 activity_area (id INT AUTO_INCREMENT NOT NULL, name VARCHAR(255) NOT NULL, PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB');
$this->addSql('CREATE TABLE situation (id INT AUTO_INCREMENT NOT NULL, name VARCHAR(255) NOT NULL, PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB');
$this->addSql('ALTER TABLE jobseeker ADD situation_id INT NOT NULL, ADD activity_area_id INT NOT NULL, ADD search VARCHAR(255) NOT NULL');
$this->addSql('ALTER TABLE jobseeker ADD CONSTRAINT FK_839DB1F3408E8AF FOREIGN KEY (situation_id) REFERENCES situation (id)');
$this->addSql('ALTER TABLE jobseeker ADD CONSTRAINT FK_839DB1FBD5D367C FOREIGN KEY (activity_area_id) REFERENCES activity_area (id)');
$this->addSql('CREATE INDEX IDX_839DB1F3408E8AF ON jobseeker (situation_id)');
$this->addSql('CREATE INDEX IDX_839DB1FBD5D367C ON jobseeker (activity_area_id)');
}
public function down(Schema $schema): void
{
// this down() migration is auto-generated, please modify it to your needs
$this->addSql('ALTER TABLE jobseeker DROP FOREIGN KEY FK_839DB1FBD5D367C');
$this->addSql('ALTER TABLE jobseeker DROP FOREIGN KEY FK_839DB1F3408E8AF');
$this->addSql('DROP TABLE activity_area');
$this->addSql('DROP TABLE situation');
$this->addSql('DROP INDEX IDX_839DB1F3408E8AF ON jobseeker');
$this->addSql('DROP INDEX IDX_839DB1FBD5D367C ON jobseeker');
$this->addSql('ALTER TABLE jobseeker DROP situation_id, DROP activity_area_id, DROP search');
}
}