migrations/Version20260111211722.php line 1

Open in your IDE?
  1. <?php
  2. declare(strict_types=1);
  3. namespace DoctrineMigrations;
  4. use Doctrine\DBAL\Schema\Schema;
  5. use Doctrine\Migrations\AbstractMigration;
  6. /**
  7.  * Auto-generated Migration: Please modify to your needs!
  8.  */
  9. final class Version20260111211722 extends AbstractMigration
  10. {
  11.     public function getDescription(): string
  12.     {
  13.         return '';
  14.     }
  15.     public function up(Schema $schema): void
  16.     {
  17.         // this up() migration is auto-generated, please modify it to your needs
  18.         $this->addSql(
  19.             '
  20.                 CREATE TABLE medical_surveillance_examination (
  21.                     id INT AUTO_INCREMENT NOT NULL COMMENT \'Internal ID\',
  22.                     created INT NOT NULL COMMENT \'Entity creation date as UNIX timestamp\',
  23.                     active SMALLINT DEFAULT 1 NOT NULL COMMENT \'Indicator if entity is active\',
  24.                     last_active_date DATE DEFAULT NULL COMMENT \'Last active date\',
  25.                     g_code VARCHAR(25) NOT NULL COMMENT \'G code for the examination\',
  26.                     follow_up_interval INT NOT NULL COMMENT \'Follow-up interval in years.\',
  27.                     is_long_term_surveillance SMALLINT NOT NULL COMMENT \'Flag indicating whether the medical surveillance is long-term. 1 = long-term, 0 = not long-term.\',
  28.                     is_mandatory_surveillance_type SMALLINT NOT NULL COMMENT \'Flag indicating whether the medical surveillance is mandatory. 1 = mandatory, 0 = not mandatory.\',
  29.                     is_optional_surveillance_type SMALLINT NOT NULL COMMENT \'Flag indicating whether the medical surveillance is optional. 1 = optional, 0 = not optional.\',
  30.                     is_suitable_surveillance_type SMALLINT NOT NULL COMMENT \'Flag indicating whether the medical surveillance is suitable. 1 = suitable, 0 = not suitable.\',
  31.                     UNIQUE INDEX UNIQ_96DD423D482129DF (g_code),
  32.                     PRIMARY KEY(id)
  33.                 ) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB
  34.             '
  35.         );
  36.         $this->addSql(
  37.             '
  38.                 CREATE TABLE medical_surveillance_examination_l10n (
  39.                     parent_entity_id INT NOT NULL COMMENT \'Internal ID\',
  40.                     language_id VARCHAR(2) NOT NULL COMMENT \'Language code in lower case (ISO 639-1)\',
  41.                     hazard_name VARCHAR(225) DEFAULT NULL COMMENT \'Examination\'\'s hazard name in referenced language\',
  42.                     INDEX IDX_979275C9706E52B3 (parent_entity_id),
  43.                     INDEX IDX_979275C982F1BAF4 (language_id),
  44.                     PRIMARY KEY(parent_entity_id, language_id)
  45.                 ) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB
  46.             '
  47.         );
  48.         $this->addSql(
  49.             '
  50.                 ALTER TABLE medical_surveillance_examination_l10n ADD CONSTRAINT FK_271A2B7D706E52B3 FOREIGN KEY
  51.                     (parent_entity_id) REFERENCES medical_surveillance_examination (id) ON DELETE CASCADE
  52.             '
  53.         );
  54.         $this->addSql(
  55.             '
  56.                 ALTER TABLE medical_surveillance_examination_l10n ADD CONSTRAINT FK_271A2B7D82F1BAF4 FOREIGN KEY
  57.                     (language_id) REFERENCES language (id) ON DELETE CASCADE
  58.             '
  59.         );
  60.         // this up() migration is auto-generated, please modify it to your needs
  61.         $created time();
  62.         $this->addSql(
  63.             '
  64.                 INSERT INTO medical_surveillance_examination
  65.                     (id, g_code, follow_up_interval, is_long_term_surveillance, is_mandatory_surveillance_type, 
  66.                      is_optional_surveillance_type, is_suitable_surveillance_type, created, active)
  67.                 VALUES
  68.                     (1, "G1.1", 3, 1, 1, 0, 0, :createdTimeStamp, 1),
  69.                     (2, "G1.2", 3, 1, 1, 0, 0, :createdTimeStamp, 1),
  70.                     (3, "G1.3", 3, 1, 1, 0, 0, :createdTimeStamp, 1),
  71.                     (4, "G1.4", 3, 0, 0, 1, 0, :createdTimeStamp, 1),
  72.                     (5, "G2", 3, 0, 1, 0, 0, :createdTimeStamp, 1),
  73.                     (6, "G3", 3, 0, 1, 0, 0, :createdTimeStamp, 1),
  74.                     (7, "G4", 3, 1, 1, 0, 0, :createdTimeStamp, 1),
  75.                     (8, "G5", 3, 0, 1, 0, 0, :createdTimeStamp, 1),
  76.                     (9, "G6", 3, 0, 1, 0, 0, :createdTimeStamp, 1),
  77.                     (10, "G7", 3, 0, 1, 0, 0, :createdTimeStamp, 1),
  78.                     (11, "G8", 3, 1, 1, 0, 0, :createdTimeStamp, 1),
  79.                     (12, "G9", 3, 0, 1, 0, 0, :createdTimeStamp, 1),
  80.                     (13, "G10", 3, 0, 1, 0, 0, :createdTimeStamp, 1),
  81.                     (14, "G11", 3, 0, 1, 0, 0, :createdTimeStamp, 1),
  82.                     (15, "G12", 3, 0, 1, 0, 0, :createdTimeStamp, 1),
  83.                     (16, "G13", 3, 0, 1, 0, 0, :createdTimeStamp, 1),
  84.                     (17, "G14", 3, 0, 1, 0, 0, :createdTimeStamp, 1),
  85.                     (18, "G15", 3, 1, 1, 0, 0, :createdTimeStamp, 1),
  86.                     (19, "G16", 3, 1, 1, 0, 0, :createdTimeStamp, 1),
  87.                     (20, "G17", 3, 0, 0, 1, 0, :createdTimeStamp, 1),
  88.                     (21, "G18", 3, 0, 1, 0, 0, :createdTimeStamp, 1),
  89.                     (22, "G19", 3, 0, 1, 0, 0, :createdTimeStamp, 1),
  90.                     (23, "G20", 3, 0, 0, 1, 0, :createdTimeStamp, 1),
  91.                     (24, "G21", 3, 0, 0, 1, 0, :createdTimeStamp, 1),
  92.                     (25, "G22", 3, 0, 0, 1, 0, :createdTimeStamp, 1),
  93.                     (26, "G23", 3, 0, 0, 1, 0, :createdTimeStamp, 1),
  94.                     (27, "G24", 3, 0, 0, 1, 0, :createdTimeStamp, 1),
  95.                     (28, "G25", 1, 0, 0, 0, 1, :createdTimeStamp, 1),
  96.                     (29, "G26", 3, 0, 1, 0, 0, :createdTimeStamp, 1),
  97.                     (30, "G27", 1, 0, 1, 0, 0, :createdTimeStamp, 1),
  98.                     (31, "G28", 3, 0, 1, 0, 0, :createdTimeStamp, 1),
  99.                     (32, "G29", 3, 0, 1, 0, 0, :createdTimeStamp, 1),
  100.                     (33, "G30", 3, 1, 1, 0, 0, :createdTimeStamp, 1),
  101.                     (34, "G31", 3, 0, 1, 0, 0, :createdTimeStamp, 1),
  102.                     (35, "G32", 3, 0, 1, 0, 0, :createdTimeStamp, 1),
  103.                     (36, "G33", 3, 0, 1, 0, 0, :createdTimeStamp, 1),
  104.                     (37, "G34", 3, 0, 1, 0, 0, :createdTimeStamp, 1),
  105.                     (38, "G35", 3, 0, 0, 1, 0, :createdTimeStamp, 1),
  106.                     (39, "G36", 3, 0, 1, 0, 0, :createdTimeStamp, 1),
  107.                     (40, "G37", 3, 0, 0, 1, 0, :createdTimeStamp, 1),
  108.                     (41, "G38", 3, 1, 1, 0, 0, :createdTimeStamp, 1),
  109.                     (42, "G40", 3, 1, 1, 0, 0, :createdTimeStamp, 1),
  110.                     (43, "G41", 3, 0, 0, 0, 1, :createdTimeStamp, 1),
  111.                     (44, "G42", 3, 1, 1, 0, 0, :createdTimeStamp, 1),
  112.                     (45, "G43", 3, 0, 1, 1, 0, :createdTimeStamp, 1),
  113.                     (46, "G44", 3, 0, 1, 1, 0, :createdTimeStamp, 1),
  114.                     (47, "G45", 3, 0, 1, 0, 0, :createdTimeStamp, 1),
  115.                     (48, "G46", 5, 0, 0, 1, 0, :createdTimeStamp, 1)
  116.                 ;
  117.             ',
  118.             ['createdTimeStamp' => $created]
  119.         );
  120.         $this->addSql(
  121.             '
  122.                 INSERT INTO medical_surveillance_examination_l10n
  123.                     (language_id, parent_entity_id, hazard_name)
  124.                 VALUES
  125.                     (\'de\', 1, \'Quarzhaltiger Staub\'),
  126.                     (\'de\', 2, \'Asbesthaltiger Staub\'),
  127.                     (\'de\', 3, \'Keramikfaserhaltiger Staub\'),
  128.                     (\'de\', 4, \'Allgemeine Staubbelastung\'),
  129.                     (\'de\', 5, \'Blei und Verbindungen\'),
  130.                     (\'de\', 6, \'Bleialkyle\'),
  131.                     (\'de\', 7, \'Hautkrebsgefährdende Stoffe\'),
  132.                     (\'de\', 8, \'Nitroglycerin/Glykoldinitrat\'),
  133.                     (\'de\', 9, \'Schwefelkohlenstoff\'),
  134.                     (\'de\', 10, \'Kohlenmonoxid\'),
  135.                     (\'de\', 11, \'Benzol\'),
  136.                     (\'de\', 12, \'Quecksilber\'),
  137.                     (\'de\', 13, \'Methanol\'),
  138.                     (\'de\', 14, \'Schwefelwasserstoff\'),
  139.                     (\'de\', 15, \'Weißer Phosphor\'),
  140.                     (\'de\', 16, \'Tetrachlormethan (Tetrachlorkohlenstoff)\'),
  141.                     (\'de\', 17, \'Trichlorethen (Trichlorethylen)\'),
  142.                     (\'de\', 18, \'Chrom(VI)-Verbindungen\'),
  143.                     (\'de\', 19, \'Arsen und Verbindungen\'),
  144.                     (\'de\', 20, \'Künstliche optische Strahlung\'),
  145.                     (\'de\', 21, \'Nitro- und Aminoverbindungen\'),
  146.                     (\'de\', 22, \'Dimethylformamid\'),
  147.                     (\'de\', 23, \'Schutzanzug\'),
  148.                     (\'de\', 24, \'Arbeiten in Kälte\'),
  149.                     (\'de\', 25, \'Säureschäden der Zähne\'),
  150.                     (\'de\', 26, \'Obstruktive Atemwegserkrankungen\'),
  151.                     (\'de\', 27, \'Hautgefährdung (Feuchtarbeit)\'),
  152.                     (\'de\', 28, \'Fahr-, Steuer- und Überwachungstätigkeiten\'),
  153.                     (\'de\', 29, \'Atemschutzgeräte (Klassen 1–3)\'),
  154.                     (\'de\', 30, \'Isocyanate\'),
  155.                     (\'de\', 31, \'Nitrobenzol und Homologe\'),
  156.                     (\'de\', 32, \'Benzolhomologe (Toluol, Xylol)\'),
  157.                     (\'de\', 33, \'Cadmium und Verbindungen\'),
  158.                     (\'de\', 34, \'Fluor und Fluorverbindungen\'),
  159.                     (\'de\', 35, \'Weitere organische Lösungsmittel\'),
  160.                     (\'de\', 36, \'Weitere organische Lösungsmittel\'),
  161.                     (\'de\', 37, \'Weitere organische Lösungsmittel\'),
  162.                     (\'de\', 38, \'Auslandseinsatz unter besonderen Bedingungen\'),
  163.                     (\'de\', 39, \'Vinylchlorid\'),
  164.                     (\'de\', 40, \'Bildschirmarbeit\'),
  165.                     (\'de\', 41, \'Nickel, Schweißrauche\'),
  166.                     (\'de\', 42, \'krebserzeugende Gefahrstoffe\'),
  167.                     (\'de\', 43, \'Arbeiten mit Absturzgefahr\'),
  168.                     (\'de\', 44, \'Infektionsgefährdung\'),
  169.                     (\'de\', 45, \'Biotechnologie\'),
  170.                     (\'de\', 46, \'Holzstaub\'),
  171.                     (\'de\', 47, \'Styrol\'),
  172.                     (\'de\', 48, \'Muskel-Skelett-Belastungen (inkl. Vibrationen)\'),
  173.                     (\'en\', 1, null),
  174.                     (\'en\', 2, null),
  175.                     (\'en\', 3, null),
  176.                     (\'en\', 4, null),
  177.                     (\'en\', 5, null),
  178.                     (\'en\', 6, null),
  179.                     (\'en\', 7, null),
  180.                     (\'en\', 8, null),
  181.                     (\'en\', 9, null),
  182.                     (\'en\', 10, null),
  183.                     (\'en\', 11, null),
  184.                     (\'en\', 12, null),
  185.                     (\'en\', 13, null),
  186.                     (\'en\', 14, null),
  187.                     (\'en\', 15, null),
  188.                     (\'en\', 16, null),
  189.                     (\'en\', 17, null),
  190.                     (\'en\', 18, null),
  191.                     (\'en\', 19, null),
  192.                     (\'en\', 20, null),
  193.                     (\'en\', 21, null),
  194.                     (\'en\', 22, null),
  195.                     (\'en\', 23, null),
  196.                     (\'en\', 24, null),
  197.                     (\'en\', 25, null),
  198.                     (\'en\', 26, null),
  199.                     (\'en\', 27, null),
  200.                     (\'en\', 28, null),
  201.                     (\'en\', 29, null),
  202.                     (\'en\', 30, null),
  203.                     (\'en\', 31, null),
  204.                     (\'en\', 32, null),
  205.                     (\'en\', 33, null),
  206.                     (\'en\', 34, null),
  207.                     (\'en\', 35, null),
  208.                     (\'en\', 36, null),
  209.                     (\'en\', 37, null),
  210.                     (\'en\', 38, null),
  211.                     (\'en\', 39, null),
  212.                     (\'en\', 40, null),
  213.                     (\'en\', 41, null),
  214.                     (\'en\', 42, null),
  215.                     (\'en\', 43, null),
  216.                     (\'en\', 44, null),
  217.                     (\'en\', 45, null),
  218.                     (\'en\', 46, null),
  219.                     (\'en\', 47, null),
  220.                     (\'en\', 48, null)
  221.                 ;
  222.             '
  223.         );
  224.     }
  225.     public function down(Schema $schema): void
  226.     {
  227.         // this down() migration is auto-generated, please modify it to your needs
  228.         $this->addSql('ALTER TABLE medical_surveillance_examination_l10n DROP FOREIGN KEY FK_271A2B7D706E52B3');
  229.         $this->addSql('ALTER TABLE medical_surveillance_examination_l10n DROP FOREIGN KEY FK_271A2B7D82F1BAF4');
  230.         $this->addSql('DROP TABLE medical_surveillance_examination');
  231.         $this->addSql('DROP TABLE medical_surveillance_examination_l10n');
  232.     }
  233. }