<?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 Version20230328123537 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_school_subject (id INT AUTO_INCREMENT NOT NULL, abbreviation VARCHAR(10) NOT NULL, subject_name VARCHAR(191) NOT NULL, PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB');
$this->addSql('CREATE TABLE job_school_subject_mapping (id INT AUTO_INCREMENT NOT NULL, job_id INT DEFAULT NULL, job_school_subject_id INT DEFAULT NULL, INDEX IDX_E4B9D019BE04EA9 (job_id), INDEX IDX_E4B9D019B3999C80 (job_school_subject_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB');
$this->addSql('CREATE TABLE job_workfield_subject_mapping (id INT AUTO_INCREMENT NOT NULL, job_workfield_id INT DEFAULT NULL, job_school_subject_id INT DEFAULT NULL, INDEX IDX_AF8B3FD1EAD7CBC0 (job_workfield_id), INDEX IDX_AF8B3FD1B3999C80 (job_school_subject_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB');
$this->addSql('ALTER TABLE job_school_subject_mapping ADD CONSTRAINT FK_E4B9D019BE04EA9 FOREIGN KEY (job_id) REFERENCES job (id)');
$this->addSql('ALTER TABLE job_school_subject_mapping ADD CONSTRAINT FK_E4B9D019B3999C80 FOREIGN KEY (job_school_subject_id) REFERENCES job_school_subject (id)');
$this->addSql('ALTER TABLE job_workfield_subject_mapping ADD CONSTRAINT FK_AF8B3FD1EAD7CBC0 FOREIGN KEY (job_workfield_id) REFERENCES job_workfield (id)');
$this->addSql('ALTER TABLE job_workfield_subject_mapping ADD CONSTRAINT FK_AF8B3FD1B3999C80 FOREIGN KEY (job_school_subject_id) REFERENCES job_school_subject (id)');
$this->addSql('ALTER TABLE job ADD show_school_subjects TINYINT(1) DEFAULT 0 NOT NULL');
}
public function down(Schema $schema): void
{
// this down() migration is auto-generated, please modify it to your needs
$this->addSql('ALTER TABLE job_school_subject_mapping DROP FOREIGN KEY FK_E4B9D019B3999C80');
$this->addSql('ALTER TABLE job_workfield_subject_mapping DROP FOREIGN KEY FK_AF8B3FD1B3999C80');
$this->addSql('DROP TABLE job_school_subject');
$this->addSql('DROP TABLE job_school_subject_mapping');
$this->addSql('DROP TABLE job_workfield_subject_mapping');
$this->addSql('ALTER TABLE job DROP show_school_subjects');
}
}