<?php
/* @noinspection PhpUnused */
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 Version20240830071552 extends AbstractMigration
{
public function down(Schema $schema): void
{
// this down() migration is auto-generated, please modify it to your needs
$this->addSql('ALTER TABLE job_lab_case_matching_rejection DROP FOREIGN KEY FK_425EC554C0EF82D7');
$this->addSql('ALTER TABLE job_lab_case_matching_rejection DROP FOREIGN KEY FK_425EC5548BC224C3');
$this->addSql('ALTER TABLE job_lab_case_matching_rejection DROP FOREIGN KEY FK_425EC554AC25FB46');
$this->addSql('DROP TABLE job_lab_case_matching_rejection');
}
public function getDescription(): string
{
return
"- Introduces job lab case matching rejection table.";
}
public function up(Schema $schema): void
{
// this up() migration is auto-generated, please modify it to your needs
$this->addSql(
'
CREATE TABLE job_lab_case_matching_rejection (
id INT AUTO_INCREMENT NOT NULL COMMENT \'Internal ID\',
job_lab_case_id INT NOT NULL COMMENT \'Internal ID\',
workplace_id INT NOT NULL COMMENT \'Internal ID\',
org_unit_id INT NOT NULL COMMENT \'Internal ID\',
created INT NOT NULL COMMENT \'Entity creation date as UNIX timestamp\',
active SMALLINT DEFAULT 1 NOT NULL COMMENT \'Indicator if entity is active\',
last_active_date DATE DEFAULT NULL COMMENT \'Last active date\',
rejection_reason TEXT NOT NULL COMMENT \'Reason for rejection\',
dirty SMALLINT NOT NULL COMMENT \'Dirty flag for the matching rejection\',
INDEX IDX_425EC554C0EF82D7 (job_lab_case_id),
INDEX IDX_425EC5548BC224C3 (org_unit_id),
INDEX IDX_425EC554AC25FB46 (workplace_id),
UNIQUE INDEX UNIQ_CASE_ENTITY_WORKPLACE_ORG_UNIT (job_lab_case_id, workplace_id, org_unit_id),
PRIMARY KEY(id)
) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB
'
);
$this->addSql(
'
ALTER TABLE job_lab_case_matching_rejection ADD CONSTRAINT FK_425EC554C0EF82D7
FOREIGN KEY (job_lab_case_id) REFERENCES job_lab_case (id) ON DELETE CASCADE;
'
);
$this->addSql(
'
ALTER TABLE job_lab_case_matching_rejection ADD CONSTRAINT FK_425EC5548BC224C3
FOREIGN KEY (org_unit_id) REFERENCES org_unit (id) ON DELETE CASCADE;
'
);
$this->addSql(
'
ALTER TABLE job_lab_case_matching_rejection ADD CONSTRAINT FK_425EC554AC25FB46
FOREIGN KEY (workplace_id) REFERENCES workplace (id) ON DELETE CASCADE;
'
);
}
}