<?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 Version20260219072449 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 cmr_employment (
id INT AUTO_INCREMENT NOT NULL COMMENT \'Internal ID\',
case_entity_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\',
job_title VARCHAR(225) NOT NULL COMMENT \'Job title\',
start_date DATE NOT NULL COMMENT \'Start date\',
end_date DATE DEFAULT NULL COMMENT \'End date\',
notes TINYTEXT DEFAULT NULL COMMENT \'Notes\',
created_by_id INT NOT NULL COMMENT \'Internal ID\',
updated_by_id INT DEFAULT NULL COMMENT \'Internal ID\',
INDEX IDX_176DAB72AF060DA6 (case_entity_id),
INDEX IDX_176DAB72DE12AB56 (created_by_id),
INDEX IDX_176DAB7216FE72E1 (updated_by_id),
PRIMARY KEY(id)
)
DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB
'
);
$this->addSql(
'
ALTER TABLE cmr_employment ADD CONSTRAINT FK_176DAB72AF060DA6 FOREIGN KEY
(case_entity_id) REFERENCES cmr_case (id) ON DELETE CASCADE
'
);
$this->addSql(
'
ALTER TABLE cmr_employment ADD CONSTRAINT FK_176DAB72DE12AB56 FOREIGN KEY
(created_by_id) REFERENCES user (id) ON DELETE CASCADE
'
);
$this->addSql(
'
ALTER TABLE cmr_employment ADD CONSTRAINT FK_176DAB7216FE72E1 FOREIGN KEY
(updated_by_id) REFERENCES user (id) ON DELETE CASCADE
'
);
}
public function down(Schema $schema): void
{
// this down() migration is auto-generated, please modify it to your needs
$this->addSql('ALTER TABLE cmr_employment DROP FOREIGN KEY FK_176DAB72AF060DA6');
$this->addSql('DROP TABLE cmr_employment');
}
}