<?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 Version20231127090354 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_market_address_mapping (job_market_id INT NOT NULL, address_id INT NOT NULL, INDEX IDX_2120A90AA59FD026 (job_market_id), INDEX IDX_2120A90AF5B7AF75 (address_id), PRIMARY KEY(job_market_id, address_id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB');
$this->addSql('ALTER TABLE job_market_address_mapping ADD CONSTRAINT FK_2120A90AA59FD026 FOREIGN KEY (job_market_id) REFERENCES job_market (id)');
$this->addSql('ALTER TABLE job_market_address_mapping ADD CONSTRAINT FK_2120A90AF5B7AF75 FOREIGN KEY (address_id) REFERENCES address (id)');
$this->addSql('ALTER TABLE job_market DROP FOREIGN KEY FK_3BA8A84A5A2FCCDC');
$this->addSql('ALTER TABLE job_market DROP FOREIGN KEY FK_3BA8A84AF5B7AF75');
$this->addSql('DROP INDEX IDX_3BA8A84A5A2FCCDC ON job_market');
$this->addSql('DROP INDEX IDX_3BA8A84AF5B7AF75 ON job_market');
$this->addSql('ALTER TABLE job_market DROP address_id, DROP company_contact_id');
$this->addSql('ALTER TABLE job_market_apply_type ADD is_visible TINYINT(1) DEFAULT 1 NOT NULL');
$this->addSql('ALTER TABLE job_market_position_type ADD position SMALLINT NOT NULL');
$this->addSql('ALTER TABLE job_pdf DROP INDEX IDX_CA25481DBE04EA9, ADD UNIQUE INDEX UNIQ_CA25481DBE04EA9 (job_id)');
}
public function down(Schema $schema): void
{
// this down() migration is auto-generated, please modify it to your needs
$this->addSql('ALTER TABLE job_market_address_mapping DROP FOREIGN KEY FK_2120A90AA59FD026');
$this->addSql('ALTER TABLE job_market_address_mapping DROP FOREIGN KEY FK_2120A90AF5B7AF75');
$this->addSql('DROP TABLE job_market_address_mapping');
$this->addSql('ALTER TABLE job_market ADD address_id INT DEFAULT NULL, ADD company_contact_id INT DEFAULT NULL');
$this->addSql('ALTER TABLE job_market ADD CONSTRAINT FK_3BA8A84A5A2FCCDC FOREIGN KEY (company_contact_id) REFERENCES company_contact (id)');
$this->addSql('ALTER TABLE job_market ADD CONSTRAINT FK_3BA8A84AF5B7AF75 FOREIGN KEY (address_id) REFERENCES address (id)');
$this->addSql('CREATE INDEX IDX_3BA8A84A5A2FCCDC ON job_market (company_contact_id)');
$this->addSql('CREATE INDEX IDX_3BA8A84AF5B7AF75 ON job_market (address_id)');
$this->addSql('ALTER TABLE job_pdf DROP INDEX UNIQ_CA25481DBE04EA9, ADD INDEX IDX_CA25481DBE04EA9 (job_id)');
$this->addSql('ALTER TABLE job_market_apply_type DROP is_visible');
$this->addSql('ALTER TABLE job_market_position_type DROP position');
}
}