migrations/Version20230620094924.php line 1

Open in your IDE?
  1. <?php
  2. /* @noinspection PhpUnused */
  3. declare(strict_types=1);
  4. namespace DoctrineMigrations;
  5. use Doctrine\DBAL\Schema\Schema;
  6. use Doctrine\Migrations\AbstractMigration;
  7. /**
  8.  * Auto-generated Migration: Please modify to your needs!
  9.  */
  10. final class Version20230620094924 extends AbstractMigration
  11. {
  12.     public function getDescription(): string
  13.     {
  14.         return '';
  15.     }
  16.     public function up(Schema $schema): void
  17.     {
  18.         // this up() migration is auto-generated, please modify it to your needs
  19.         $this->addSql(
  20.             '
  21.                 CREATE TABLE skill_screening_case (
  22.                     id INT AUTO_INCREMENT NOT NULL COMMENT \'Internal ID\',
  23.                     created_by INT NOT NULL COMMENT \'Internal ID\',
  24.                     employee_id INT NOT NULL COMMENT \'Internal ID\',
  25.                     created INT NOT NULL COMMENT \'Entity creation date as UNIX timestamp\',
  26.                     active SMALLINT DEFAULT 1 NOT NULL COMMENT \'Indicator if entity is active\',
  27.                     last_active_date DATE DEFAULT NULL COMMENT \'Last active date\',
  28.                     INDEX IDX_9EFB27B8DE12AB56 (created_by),
  29.                     UNIQUE INDEX UNIQ_9EFB27B88C03F15C (employee_id),
  30.                     PRIMARY KEY(id)
  31.                 ) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB;
  32.             '
  33.         );
  34.         $this->addSql(
  35.             '
  36.                 CREATE TABLE skill_screening (
  37.                     id INT AUTO_INCREMENT NOT NULL COMMENT \'Internal ID\',
  38.                     created_by INT NOT NULL COMMENT \'Internal ID\',
  39.                     updated_by INT DEFAULT NULL COMMENT \'Internal ID\',
  40.                     case_entity_id INT NOT NULL COMMENT \'Internal ID\',
  41.                     created INT NOT NULL COMMENT \'Entity creation date as UNIX timestamp\',
  42.                     active SMALLINT DEFAULT 1 NOT NULL COMMENT \'Indicator if entity is active\',
  43.                     last_active_date DATE DEFAULT NULL COMMENT \'Last active date\',
  44.                     name VARCHAR(225) DEFAULT NULL COMMENT \'Name for the screening\',
  45.                     screening_date DATETIME DEFAULT NULL COMMENT \'Date for the screening\',
  46.                     general_requirements_drivers_licence_b SMALLINT DEFAULT 0 NOT NULL
  47.                         COMMENT \'General requirements driver\'\'s licence B\',
  48.                     general_requirements_drivers_licence_c_ce SMALLINT DEFAULT 0 NOT NULL
  49.                         COMMENT \'General requirements driver\'\'s licence C/CE\',
  50.                     general_requirements_drivers_licence_floor_conveyors SMALLINT DEFAULT 0 NOT NULL
  51.                         COMMENT \'General requirements driver\'\'s licence floor conveyors\',
  52.                     general_requirements_education TEXT DEFAULT NULL COMMENT \'General requirements education\',
  53.                     general_requirements_qualification_notes_from_request TEXT DEFAULT NULL
  54.                         COMMENT \'General requirements qualification notes from request\',
  55.                     general_requirements_seating_opportunity_available SMALLINT DEFAULT 0 NOT NULL
  56.                         COMMENT \'General requirements availability of seating opportunity\',
  57.                     general_requirements_seating_workplace SMALLINT DEFAULT 0 NOT NULL
  58.                         COMMENT \'General requirements 100 % seating workplace\',
  59.                     general_requirements_workplace_with_visible_colleagues SMALLINT DEFAULT 0 NOT NULL
  60.                         COMMENT \'General requirements visibility of colleagues at workplace\',
  61.                     notes TEXT DEFAULT NULL COMMENT \'Notes for the screening\',
  62.                     updated INT DEFAULT NULL COMMENT \'Entity update date as UNIX timestamp\',
  63.                     work_organization_normal_shift SMALLINT DEFAULT 0 NOT NULL
  64.                         COMMENT \'Work organization normal shift\',
  65.                     work_organization_alternation_shift_without_night SMALLINT DEFAULT 0 NOT NULL
  66.                         COMMENT \'Work organization alternation shift without night\',
  67.                     work_organization_alternation_shift_with_night SMALLINT DEFAULT 0 NOT NULL
  68.                         COMMENT \'Work organization alternation shift with night\',
  69.                     work_organization_permanent_night_shift SMALLINT DEFAULT 0 NOT NULL
  70.                         COMMENT \'Work organization permanent night shift\',
  71.                     work_organization_rigid_tact_binding SMALLINT DEFAULT 0 NOT NULL
  72.                         COMMENT \'Work organization rigid tact binding\',
  73.                     work_organization_driving_and_steering_activities SMALLINT DEFAULT 0 NOT NULL
  74.                         COMMENT \'Work organization driving and steering activities\',
  75.                     work_organization_forklift_activities SMALLINT DEFAULT 0 NOT NULL
  76.                         COMMENT \'Work organization forklift activities\',
  77.                     other_impacts_deployment_on_rotating_machines SMALLINT DEFAULT 0 NOT NULL
  78.                         COMMENT \'Other impacts deployment on rotating machines\',
  79.                     other_impacts_falling_hazard SMALLINT DEFAULT 0 NOT NULL COMMENT \'Other impacts falling hazard\',
  80.                     other_impacts_full_body_vibrations SMALLINT DEFAULT 0 NOT NULL
  81.                         COMMENT \'Other impacts full body vibrations\',
  82.                     other_impacts_right_hand_arm_vibrations SMALLINT DEFAULT 0 NOT NULL
  83.                         COMMENT \'Other impacts right hand arm vibrations\',
  84.                     other_impacts_left_hand_arm_vibrations SMALLINT DEFAULT 0 NOT NULL
  85.                         COMMENT \'Other impacts left hand arm vibrations\',
  86.                     other_impacts_electromagnetic_fields SMALLINT DEFAULT 0 NOT NULL
  87.                         COMMENT \'Other impacts electromagnetic fields\',
  88.                     other_impacts_heat SMALLINT DEFAULT 0 NOT NULL COMMENT \'Other impacts heat\',
  89.                     other_impacts_impairing_noise SMALLINT DEFAULT 0 NOT NULL COMMENT \'Other impacts impairing noise\',
  90.                     other_impacts_dangerous_noise SMALLINT DEFAULT 0 NOT NULL COMMENT \'Other impacts dangerous noise\',
  91.                     other_impacts_solvents_and_varnishes SMALLINT DEFAULT 0 NOT NULL
  92.                         COMMENT \'Other impacts solvents and varnishes\',
  93.                     other_impacts_gases_vapors_aerosol_dust_smoke SMALLINT DEFAULT 0 NOT NULL
  94.                         COMMENT \'Other impacts gases vapors aerosol dust smoke\',
  95.                     other_impacts_oil_fat_emulsions SMALLINT DEFAULT 0 NOT NULL
  96.                         COMMENT \'Other impacts oil fat emulsions\',
  97.                     other_impacts_wet_room_works SMALLINT DEFAULT 0 NOT NULL COMMENT \'Other impacts wet room works\',
  98.                     information_perception_visual_acuity_close SMALLINT DEFAULT 0 NOT NULL
  99.                         COMMENT \'Information perception visual acuity close\',
  100.                     information_perception_visual_acuity_far SMALLINT DEFAULT 0 NOT NULL
  101.                         COMMENT \'Information perception visual acuity far\',
  102.                     information_perception_spatial_vision SMALLINT DEFAULT 0 NOT NULL
  103.                         COMMENT \'Information perception spatial vision\',
  104.                     information_perception_color_vision SMALLINT DEFAULT 0 NOT NULL
  105.                         COMMENT \'Information perception color vision\',
  106.                     information_perception_sound_or_speech_recognition SMALLINT DEFAULT 0 NOT NULL
  107.                         COMMENT \'Information perception sound or speech recognition\',
  108.                     manual_load_handling_transfer_carry_hold_00_to_03_kg SMALLINT DEFAULT 0 NOT NULL
  109.                         COMMENT \'Manual load handling transfer carry hold 00 to 03 kg\',
  110.                     manual_load_handling_transfer_carry_hold_03_to_10_kg SMALLINT DEFAULT 0 NOT NULL
  111.                         COMMENT \'Manual load handling transfer carry hold > 03 to 10 kg\',
  112.                     manual_load_handling_transfer_carry_hold_10_to_15_kg SMALLINT DEFAULT 0 NOT NULL
  113.                         COMMENT \'Manual load handling transfer carry hold > 10 to 15 kg\',
  114.                     manual_load_handling_transfer_carry_hold_15_to_25_kg SMALLINT DEFAULT 0 NOT NULL
  115.                         COMMENT \'Manual load handling transfer carry hold > 15 to 25 kg\',
  116.                     manual_load_handling_transfer_carry_hold_gt_25_kg SMALLINT DEFAULT 0 NOT NULL
  117.                         COMMENT \'Manual load handling transfer carry hold > 25 kg\',
  118.                     forces_motions_finger_hand_left_high_pressure_overall SMALLINT DEFAULT 0 NOT NULL
  119.                         COMMENT \'Forces motions finger hand left high pressure overall\',
  120.                     forces_motions_finger_hand_left_high_pressure_per_minute SMALLINT DEFAULT 0 NOT NULL
  121.                         COMMENT \'Forces motions finger hand left high pressure per minute\',
  122.                     forces_motions_finger_hand_left_light_pressure_overall SMALLINT DEFAULT 0 NOT NULL
  123.                         COMMENT \'Forces motions finger hand left light pressure overall\',
  124.                     forces_motions_finger_hand_left_light_pressure_per_minute SMALLINT DEFAULT 0 NOT NULL
  125.                         COMMENT \'Forces motions finger hand left light pressure per minute\',
  126.                     forces_motions_finger_hand_right_high_pressure_overall SMALLINT DEFAULT 0 NOT NULL
  127.                         COMMENT \'Forces motions finger hand right high pressure overall\',
  128.                     forces_motions_finger_hand_right_high_pressure_per_minute SMALLINT DEFAULT 0 NOT NULL
  129.                         COMMENT \'Forces motions finger hand right high pressure per minute\',
  130.                     forces_motions_finger_hand_right_light_pressure_overall SMALLINT DEFAULT 0 NOT NULL
  131.                         COMMENT \'Forces motions finger hand right light pressure overall\',
  132.                     forces_motions_finger_hand_right_light_pressure_per_minute SMALLINT DEFAULT 0 NOT NULL
  133.                         COMMENT \'Forces motions finger hand right light pressure per minute\',
  134.                     forces_motions_left_forearm_rotation_overall SMALLINT DEFAULT 0 NOT NULL
  135.                         COMMENT \'Forces motions left forearm rotation overall\',
  136.                     forces_motions_left_forearm_rotation_per_minute SMALLINT DEFAULT 0 NOT NULL
  137.                         COMMENT \'Forces motions left forearm rotation per minute\',
  138.                     forces_motions_right_forearm_rotation_overall SMALLINT DEFAULT 0 NOT NULL
  139.                         COMMENT \'Forces motions right forearm rotation overall\',
  140.                     forces_motions_right_forearm_rotation_per_minute SMALLINT DEFAULT 0 NOT NULL
  141.                         COMMENT \'Forces motions right forearm rotation per minute\',
  142.                     forces_motions_handling_of_small_tools_overall SMALLINT DEFAULT 0 NOT NULL
  143.                         COMMENT \'Forces motions handling of small tools overall\',
  144.                     forces_motions_handling_of_small_tools_per_minute SMALLINT DEFAULT 0 NOT NULL
  145.                         COMMENT \'Forces motions handling of small tools per minute\',
  146.                     forces_motions_forceful_work_with_small_tools_000_to_030_n SMALLINT DEFAULT 0 NOT NULL
  147.                         COMMENT \'Forces motions forceful work with small tools < 30 N\',
  148.                     forces_motions_forceful_work_with_small_tools_030_to_100_n SMALLINT DEFAULT 0 NOT NULL
  149.                         COMMENT \'Forces motions forceful work with small tools > 30 to 100 N\',
  150.                     forces_motions_forceful_work_with_small_tools_100_to_150_n SMALLINT DEFAULT 0 NOT NULL
  151.                         COMMENT \'Forces motions forceful work with small tools > 100 to 150 N\',
  152.                     forces_motions_forceful_work_with_small_tools_150_to_250_n SMALLINT DEFAULT 0 NOT NULL
  153.                         COMMENT \'Forces motions forceful work with small tools > 150 to 250 N\',
  154.                     forces_motions_forceful_work_with_small_tools_gt_250_n SMALLINT DEFAULT 0 NOT NULL
  155.                         COMMENT \'Forces motions forceful work with small tools > 250 N\',
  156.                     postures_climbing SMALLINT DEFAULT 0 NOT NULL COMMENT \'Postures climbing\',
  157.                     postures_kneeling SMALLINT DEFAULT 0 NOT NULL COMMENT \'Postures kneeling\',
  158.                     postures_walking SMALLINT DEFAULT 0 NOT NULL COMMENT \'Postures walking\',
  159.                     postures_seating SMALLINT DEFAULT 0 NOT NULL COMMENT \'Postures seating\',
  160.                     postures_standing SMALLINT DEFAULT 0 NOT NULL COMMENT \'Postures standing\',
  161.                     postures_bent_forward SMALLINT DEFAULT 0 NOT NULL COMMENT \'Postures bent forward\',
  162.                     postures_bent_forward_motion SMALLINT DEFAULT 0 NOT NULL COMMENT \'Postures bent forward motion\',
  163.                     postures_bent_forward_strongly SMALLINT DEFAULT 0 NOT NULL
  164.                         COMMENT \'Postures bent forward strongly\',
  165.                     postures_bent_forward_strongly_motion SMALLINT DEFAULT 0 NOT NULL
  166.                         COMMENT \'Postures bent forward strongly motion\',
  167.                     postures_torsion SMALLINT DEFAULT 0 NOT NULL COMMENT \'Postures torsion\',
  168.                     postures_torsion_motion SMALLINT DEFAULT 0 NOT NULL COMMENT \'Postures torsion motion\',
  169.                     postures_lateral_torso_inclination SMALLINT DEFAULT 0 NOT NULL
  170.                         COMMENT \'Postures lateral torso inclination\',
  171.                     postures_lateral_torso_inclination_motion SMALLINT DEFAULT 0 NOT NULL
  172.                         COMMENT \'Postures lateral torso inclination motion\',
  173.                     postures_left_arm_above_head SMALLINT DEFAULT 0 NOT NULL COMMENT \'Postures left arm above head\',
  174.                     postures_left_arm_above_head_motion SMALLINT DEFAULT 0 NOT NULL
  175.                         COMMENT \'Postures left arm above head motion\',
  176.                     postures_left_arm_above_shoulder_height SMALLINT DEFAULT 0 NOT NULL
  177.                         COMMENT \'Postures left arm above shoulder height\',
  178.                     postures_left_arm_above_shoulder_height_motion SMALLINT DEFAULT 0 NOT NULL
  179.                         COMMENT \'Postures left arm above shoulder height motion\',
  180.                     postures_right_arm_above_head SMALLINT DEFAULT 0 NOT NULL COMMENT \'Postures right arm above head\',
  181.                     postures_right_arm_above_head_motion SMALLINT DEFAULT 0 NOT NULL
  182.                         COMMENT \'Postures right arm above head motion\',
  183.                     postures_right_arm_above_shoulder_height SMALLINT DEFAULT 0 NOT NULL
  184.                         COMMENT \'Postures right arm above shoulder height\',
  185.                     postures_right_arm_above_shoulder_height_motion SMALLINT DEFAULT 0 NOT NULL
  186.                         COMMENT \'Postures right arm above shoulder height motion\',
  187.                     valid_until DATETIME DEFAULT NULL COMMENT \'Date of validation end for the screening\',
  188.                     status VARCHAR(16) NOT NULL COMMENT \'Status of the skill screening\',
  189.                     workplace_planned_capacity SMALLINT NOT NULL
  190.                         COMMENT \'Employee is working at the planned capacity of the workplace\',
  191.                     workplace_rotation_unrestricted SMALLINT NOT NULL
  192.                         COMMENT \'Employee is unrestricted to rotate the workplace\',
  193.                     workplace_has_crane_or_forklift_activities SMALLINT DEFAULT 0 NOT NULL
  194.                         COMMENT \'Workplace has crane or forklift activities\',
  195.                     no_long_term_health_problems SMALLINT NOT NULL
  196.                         COMMENT \'Employee has no long-term health problems in the workplace\',
  197.                     able_to_work SMALLINT NOT NULL
  198.                         COMMENT \'Employee is incapacitated for work but can carry out his previous job\',
  199.                     workplace_change_needed SMALLINT NOT NULL COMMENT \'Change of Workplace is needed\',
  200.                     additional_information text DEFAULT NULL COMMENT \'Additional Information\',
  201.                     accepted_date DATE DEFAULT NULL COMMENT \'Request accepted date\',
  202.                     rejected_reason TEXT DEFAULT NULL COMMENT \'Request rejected reason\',
  203.                     rejected_date DATE DEFAULT NULL COMMENT \'Request rejected date\',
  204.                     INDEX IDX_E4F91220DE12AB56 (created_by),
  205.                     INDEX IDX_E4F9122016FE72E1 (updated_by),
  206.                     INDEX IDX_E4F91220AF060DA6 (case_entity_id),
  207.                     PRIMARY KEY(id)
  208.                 ) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB;
  209.             '
  210.         );
  211.         $this->addSql(
  212.             '
  213.                 ALTER TABLE skill_screening ADD CONSTRAINT FK_E4F91220DE12AB56
  214.                     FOREIGN KEY (created_by) REFERENCES user (id);
  215.             '
  216.         );
  217.         $this->addSql(
  218.             '
  219.                 ALTER TABLE skill_screening ADD CONSTRAINT FK_E4F9122016FE72E1
  220.                     FOREIGN KEY (updated_by) REFERENCES user (id);
  221.             '
  222.         );
  223.         $this->addSql(
  224.             '
  225.                 ALTER TABLE skill_screening ADD CONSTRAINT FK_E4F91220AF060DA6
  226.                     FOREIGN KEY (case_entity_id) REFERENCES skill_screening_case (id) ON DELETE CASCADE;
  227.             '
  228.         );
  229.         $this->addSql(
  230.             '
  231.                 ALTER TABLE skill_screening_case ADD CONSTRAINT FK_9EFB27B8DE12AB56
  232.                     FOREIGN KEY (created_by) REFERENCES user (id);
  233.             '
  234.         );
  235.         $this->addSql(
  236.             '
  237.                 ALTER TABLE skill_screening_case ADD CONSTRAINT FK_9EFB27B88C03F15C
  238.                     FOREIGN KEY (employee_id) REFERENCES employee (id);
  239.             '
  240.         );
  241.     }
  242.     public function down(Schema $schema): void
  243.     {
  244.         // this down() migration is auto-generated, please modify it to your needs
  245.         $this->addSql('ALTER TABLE skill_screening DROP FOREIGN KEY FK_E4F91220DE12AB56');
  246.         $this->addSql('ALTER TABLE skill_screening DROP FOREIGN KEY FK_E4F9122016FE72E1');
  247.         $this->addSql('ALTER TABLE skill_screening DROP FOREIGN KEY FK_E4F91220AF060DA6');
  248.         $this->addSql('ALTER TABLE skill_screening_case DROP FOREIGN KEY FK_9EFB27B8DE12AB56');
  249.         $this->addSql('ALTER TABLE skill_screening_case DROP FOREIGN KEY FK_9EFB27B88C03F15C');
  250.         $this->addSql('DROP TABLE skill_screening');
  251.         $this->addSql('DROP TABLE skill_screening_case');
  252.     }
  253. }