<?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 Version20230202120244 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 job_requirement_mapping (job_id INT NOT NULL, job_requirement_id INT NOT NULL, INDEX IDX_E0C3D05FBE04EA9 (job_id), INDEX IDX_E0C3D05FE92E3FB2 (job_requirement_id), PRIMARY KEY(job_id, job_requirement_id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB');
$this->addSql('CREATE TABLE job_requirement (id INT AUTO_INCREMENT NOT NULL, job_requirement_type_id INT DEFAULT NULL, bic_id INT DEFAULT NULL, requirement_name VARCHAR(191) NOT NULL, description MEDIUMTEXT DEFAULT NULL, INDEX IDX_B8534E196C697046 (job_requirement_type_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB');
$this->addSql('CREATE TABLE job_requirement_type (id INT AUTO_INCREMENT NOT NULL, bic_id INT DEFAULT NULL, type_name VARCHAR(191) NOT NULL, PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB');
$this->addSql('ALTER TABLE job_requirement_mapping ADD CONSTRAINT FK_E0C3D05FBE04EA9 FOREIGN KEY (job_id) REFERENCES job (id)');
$this->addSql('ALTER TABLE job_requirement_mapping ADD CONSTRAINT FK_E0C3D05FE92E3FB2 FOREIGN KEY (job_requirement_id) REFERENCES job_requirement (id)');
$this->addSql('ALTER TABLE job_requirement ADD CONSTRAINT FK_B8534E196C697046 FOREIGN KEY (job_requirement_type_id) REFERENCES job_requirement_type (id)');
}
public function down(Schema $schema): void
{
// this down() migration is auto-generated, please modify it to your needs
$this->addSql('ALTER TABLE job_requirement_mapping DROP FOREIGN KEY FK_E0C3D05FE92E3FB2');
$this->addSql('ALTER TABLE job_requirement DROP FOREIGN KEY FK_B8534E196C697046');
$this->addSql('DROP TABLE job_requirement_mapping');
$this->addSql('DROP TABLE job_requirement');
$this->addSql('DROP TABLE job_requirement_type');
}
}