<?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 Version20260111211722 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 medical_surveillance_examination (
id INT AUTO_INCREMENT 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\',
g_code VARCHAR(25) NOT NULL COMMENT \'G code for the examination\',
follow_up_interval INT NOT NULL COMMENT \'Follow-up interval in years.\',
is_long_term_surveillance SMALLINT NOT NULL COMMENT \'Flag indicating whether the medical surveillance is long-term. 1 = long-term, 0 = not long-term.\',
is_mandatory_surveillance_type SMALLINT NOT NULL COMMENT \'Flag indicating whether the medical surveillance is mandatory. 1 = mandatory, 0 = not mandatory.\',
is_optional_surveillance_type SMALLINT NOT NULL COMMENT \'Flag indicating whether the medical surveillance is optional. 1 = optional, 0 = not optional.\',
is_suitable_surveillance_type SMALLINT NOT NULL COMMENT \'Flag indicating whether the medical surveillance is suitable. 1 = suitable, 0 = not suitable.\',
UNIQUE INDEX UNIQ_96DD423D482129DF (g_code),
PRIMARY KEY(id)
) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB
'
);
$this->addSql(
'
CREATE TABLE medical_surveillance_examination_l10n (
parent_entity_id INT NOT NULL COMMENT \'Internal ID\',
language_id VARCHAR(2) NOT NULL COMMENT \'Language code in lower case (ISO 639-1)\',
hazard_name VARCHAR(225) DEFAULT NULL COMMENT \'Examination\'\'s hazard name in referenced language\',
INDEX IDX_979275C9706E52B3 (parent_entity_id),
INDEX IDX_979275C982F1BAF4 (language_id),
PRIMARY KEY(parent_entity_id, language_id)
) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB
'
);
$this->addSql(
'
ALTER TABLE medical_surveillance_examination_l10n ADD CONSTRAINT FK_271A2B7D706E52B3 FOREIGN KEY
(parent_entity_id) REFERENCES medical_surveillance_examination (id) ON DELETE CASCADE
'
);
$this->addSql(
'
ALTER TABLE medical_surveillance_examination_l10n ADD CONSTRAINT FK_271A2B7D82F1BAF4 FOREIGN KEY
(language_id) REFERENCES language (id) ON DELETE CASCADE
'
);
// this up() migration is auto-generated, please modify it to your needs
$created = time();
$this->addSql(
'
INSERT INTO medical_surveillance_examination
(id, g_code, follow_up_interval, is_long_term_surveillance, is_mandatory_surveillance_type,
is_optional_surveillance_type, is_suitable_surveillance_type, created, active)
VALUES
(1, "G1.1", 3, 1, 1, 0, 0, :createdTimeStamp, 1),
(2, "G1.2", 3, 1, 1, 0, 0, :createdTimeStamp, 1),
(3, "G1.3", 3, 1, 1, 0, 0, :createdTimeStamp, 1),
(4, "G1.4", 3, 0, 0, 1, 0, :createdTimeStamp, 1),
(5, "G2", 3, 0, 1, 0, 0, :createdTimeStamp, 1),
(6, "G3", 3, 0, 1, 0, 0, :createdTimeStamp, 1),
(7, "G4", 3, 1, 1, 0, 0, :createdTimeStamp, 1),
(8, "G5", 3, 0, 1, 0, 0, :createdTimeStamp, 1),
(9, "G6", 3, 0, 1, 0, 0, :createdTimeStamp, 1),
(10, "G7", 3, 0, 1, 0, 0, :createdTimeStamp, 1),
(11, "G8", 3, 1, 1, 0, 0, :createdTimeStamp, 1),
(12, "G9", 3, 0, 1, 0, 0, :createdTimeStamp, 1),
(13, "G10", 3, 0, 1, 0, 0, :createdTimeStamp, 1),
(14, "G11", 3, 0, 1, 0, 0, :createdTimeStamp, 1),
(15, "G12", 3, 0, 1, 0, 0, :createdTimeStamp, 1),
(16, "G13", 3, 0, 1, 0, 0, :createdTimeStamp, 1),
(17, "G14", 3, 0, 1, 0, 0, :createdTimeStamp, 1),
(18, "G15", 3, 1, 1, 0, 0, :createdTimeStamp, 1),
(19, "G16", 3, 1, 1, 0, 0, :createdTimeStamp, 1),
(20, "G17", 3, 0, 0, 1, 0, :createdTimeStamp, 1),
(21, "G18", 3, 0, 1, 0, 0, :createdTimeStamp, 1),
(22, "G19", 3, 0, 1, 0, 0, :createdTimeStamp, 1),
(23, "G20", 3, 0, 0, 1, 0, :createdTimeStamp, 1),
(24, "G21", 3, 0, 0, 1, 0, :createdTimeStamp, 1),
(25, "G22", 3, 0, 0, 1, 0, :createdTimeStamp, 1),
(26, "G23", 3, 0, 0, 1, 0, :createdTimeStamp, 1),
(27, "G24", 3, 0, 0, 1, 0, :createdTimeStamp, 1),
(28, "G25", 1, 0, 0, 0, 1, :createdTimeStamp, 1),
(29, "G26", 3, 0, 1, 0, 0, :createdTimeStamp, 1),
(30, "G27", 1, 0, 1, 0, 0, :createdTimeStamp, 1),
(31, "G28", 3, 0, 1, 0, 0, :createdTimeStamp, 1),
(32, "G29", 3, 0, 1, 0, 0, :createdTimeStamp, 1),
(33, "G30", 3, 1, 1, 0, 0, :createdTimeStamp, 1),
(34, "G31", 3, 0, 1, 0, 0, :createdTimeStamp, 1),
(35, "G32", 3, 0, 1, 0, 0, :createdTimeStamp, 1),
(36, "G33", 3, 0, 1, 0, 0, :createdTimeStamp, 1),
(37, "G34", 3, 0, 1, 0, 0, :createdTimeStamp, 1),
(38, "G35", 3, 0, 0, 1, 0, :createdTimeStamp, 1),
(39, "G36", 3, 0, 1, 0, 0, :createdTimeStamp, 1),
(40, "G37", 3, 0, 0, 1, 0, :createdTimeStamp, 1),
(41, "G38", 3, 1, 1, 0, 0, :createdTimeStamp, 1),
(42, "G40", 3, 1, 1, 0, 0, :createdTimeStamp, 1),
(43, "G41", 3, 0, 0, 0, 1, :createdTimeStamp, 1),
(44, "G42", 3, 1, 1, 0, 0, :createdTimeStamp, 1),
(45, "G43", 3, 0, 1, 1, 0, :createdTimeStamp, 1),
(46, "G44", 3, 0, 1, 1, 0, :createdTimeStamp, 1),
(47, "G45", 3, 0, 1, 0, 0, :createdTimeStamp, 1),
(48, "G46", 5, 0, 0, 1, 0, :createdTimeStamp, 1)
;
',
['createdTimeStamp' => $created]
);
$this->addSql(
'
INSERT INTO medical_surveillance_examination_l10n
(language_id, parent_entity_id, hazard_name)
VALUES
(\'de\', 1, \'Quarzhaltiger Staub\'),
(\'de\', 2, \'Asbesthaltiger Staub\'),
(\'de\', 3, \'Keramikfaserhaltiger Staub\'),
(\'de\', 4, \'Allgemeine Staubbelastung\'),
(\'de\', 5, \'Blei und Verbindungen\'),
(\'de\', 6, \'Bleialkyle\'),
(\'de\', 7, \'Hautkrebsgefährdende Stoffe\'),
(\'de\', 8, \'Nitroglycerin/Glykoldinitrat\'),
(\'de\', 9, \'Schwefelkohlenstoff\'),
(\'de\', 10, \'Kohlenmonoxid\'),
(\'de\', 11, \'Benzol\'),
(\'de\', 12, \'Quecksilber\'),
(\'de\', 13, \'Methanol\'),
(\'de\', 14, \'Schwefelwasserstoff\'),
(\'de\', 15, \'Weißer Phosphor\'),
(\'de\', 16, \'Tetrachlormethan (Tetrachlorkohlenstoff)\'),
(\'de\', 17, \'Trichlorethen (Trichlorethylen)\'),
(\'de\', 18, \'Chrom(VI)-Verbindungen\'),
(\'de\', 19, \'Arsen und Verbindungen\'),
(\'de\', 20, \'Künstliche optische Strahlung\'),
(\'de\', 21, \'Nitro- und Aminoverbindungen\'),
(\'de\', 22, \'Dimethylformamid\'),
(\'de\', 23, \'Schutzanzug\'),
(\'de\', 24, \'Arbeiten in Kälte\'),
(\'de\', 25, \'Säureschäden der Zähne\'),
(\'de\', 26, \'Obstruktive Atemwegserkrankungen\'),
(\'de\', 27, \'Hautgefährdung (Feuchtarbeit)\'),
(\'de\', 28, \'Fahr-, Steuer- und Überwachungstätigkeiten\'),
(\'de\', 29, \'Atemschutzgeräte (Klassen 1–3)\'),
(\'de\', 30, \'Isocyanate\'),
(\'de\', 31, \'Nitrobenzol und Homologe\'),
(\'de\', 32, \'Benzolhomologe (Toluol, Xylol)\'),
(\'de\', 33, \'Cadmium und Verbindungen\'),
(\'de\', 34, \'Fluor und Fluorverbindungen\'),
(\'de\', 35, \'Weitere organische Lösungsmittel\'),
(\'de\', 36, \'Weitere organische Lösungsmittel\'),
(\'de\', 37, \'Weitere organische Lösungsmittel\'),
(\'de\', 38, \'Auslandseinsatz unter besonderen Bedingungen\'),
(\'de\', 39, \'Vinylchlorid\'),
(\'de\', 40, \'Bildschirmarbeit\'),
(\'de\', 41, \'Nickel, Schweißrauche\'),
(\'de\', 42, \'krebserzeugende Gefahrstoffe\'),
(\'de\', 43, \'Arbeiten mit Absturzgefahr\'),
(\'de\', 44, \'Infektionsgefährdung\'),
(\'de\', 45, \'Biotechnologie\'),
(\'de\', 46, \'Holzstaub\'),
(\'de\', 47, \'Styrol\'),
(\'de\', 48, \'Muskel-Skelett-Belastungen (inkl. Vibrationen)\'),
(\'en\', 1, null),
(\'en\', 2, null),
(\'en\', 3, null),
(\'en\', 4, null),
(\'en\', 5, null),
(\'en\', 6, null),
(\'en\', 7, null),
(\'en\', 8, null),
(\'en\', 9, null),
(\'en\', 10, null),
(\'en\', 11, null),
(\'en\', 12, null),
(\'en\', 13, null),
(\'en\', 14, null),
(\'en\', 15, null),
(\'en\', 16, null),
(\'en\', 17, null),
(\'en\', 18, null),
(\'en\', 19, null),
(\'en\', 20, null),
(\'en\', 21, null),
(\'en\', 22, null),
(\'en\', 23, null),
(\'en\', 24, null),
(\'en\', 25, null),
(\'en\', 26, null),
(\'en\', 27, null),
(\'en\', 28, null),
(\'en\', 29, null),
(\'en\', 30, null),
(\'en\', 31, null),
(\'en\', 32, null),
(\'en\', 33, null),
(\'en\', 34, null),
(\'en\', 35, null),
(\'en\', 36, null),
(\'en\', 37, null),
(\'en\', 38, null),
(\'en\', 39, null),
(\'en\', 40, null),
(\'en\', 41, null),
(\'en\', 42, null),
(\'en\', 43, null),
(\'en\', 44, null),
(\'en\', 45, null),
(\'en\', 46, null),
(\'en\', 47, null),
(\'en\', 48, null)
;
'
);
}
public function down(Schema $schema): void
{
// this down() migration is auto-generated, please modify it to your needs
$this->addSql('ALTER TABLE medical_surveillance_examination_l10n DROP FOREIGN KEY FK_271A2B7D706E52B3');
$this->addSql('ALTER TABLE medical_surveillance_examination_l10n DROP FOREIGN KEY FK_271A2B7D82F1BAF4');
$this->addSql('DROP TABLE medical_surveillance_examination');
$this->addSql('DROP TABLE medical_surveillance_examination_l10n');
}
}