migrations/Version20260128112000.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 Version20260128112000 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 cmr_protective_gloves_material (
  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.                     PRIMARY KEY(id)
  26.                ) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB
  27.            '
  28.         );
  29.         $this->addSql(
  30.             '
  31.                 CREATE TABLE cmr_protective_gloves_material_l10n (
  32.                     parent_entity_id INT NOT NULL COMMENT \'Internal ID\', 
  33.                     language_id VARCHAR(2) NOT NULL COMMENT \'Language code in lower case (ISO 639-1)\', 
  34.                     name VARCHAR(225) DEFAULT NULL COMMENT \'Protective gloves material name in referenced language\', 
  35.                     INDEX IDX_24042444706E52B3 (parent_entity_id), 
  36.                     INDEX IDX_2404244482F1BAF4 (language_id), 
  37.                     PRIMARY KEY(parent_entity_id, language_id)
  38.                 ) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB
  39.             '
  40.         );
  41.         $this->addSql(
  42.             '
  43.                 ALTER TABLE cmr_protective_gloves_material_l10n ADD CONSTRAINT FK_24042444706E52B3 FOREIGN KEY 
  44.                     (parent_entity_id) REFERENCES cmr_protective_gloves_material (id) ON DELETE CASCADE
  45.              '
  46.         );
  47.         $this->addSql(
  48.             '
  49.                 ALTER TABLE cmr_protective_gloves_material_l10n ADD CONSTRAINT FK_2404244482F1BAF4 FOREIGN KEY 
  50.                     (language_id) REFERENCES language (id) ON DELETE CASCADE
  51.             '
  52.         );
  53.         // this up() migration is auto-generated, please modify it to your needs
  54.         $created time();
  55.         $this->addSql(
  56.             '
  57.                 INSERT INTO cmr_protective_gloves_material
  58.                     (id, created, active)
  59.                 VALUES
  60.                     (1, :createdTimeStamp, 1),
  61.                     (2, :createdTimeStamp, 1),
  62.                     (3, :createdTimeStamp, 1),
  63.                     (4, :createdTimeStamp, 1),
  64.                     (5, :createdTimeStamp, 1),
  65.                     (6, :createdTimeStamp, 1),
  66.                     (7, :createdTimeStamp, 1),
  67.                     (8, :createdTimeStamp, 1),
  68.                     (9, :createdTimeStamp, 1),
  69.                     (10, :createdTimeStamp, 1),
  70.                     (11, :createdTimeStamp, 1),
  71.                     (12, :createdTimeStamp, 1),
  72.                     (13, :createdTimeStamp, 1),
  73.                     (14, :createdTimeStamp, 1),
  74.                     (15, :createdTimeStamp, 1),
  75.                     (16, :createdTimeStamp, 1),
  76.                     (17, :createdTimeStamp, 1),
  77.                     (18, :createdTimeStamp, 1),
  78.                     (19, :createdTimeStamp, 1),
  79.                     (20, :createdTimeStamp, 1),
  80.                     (21, :createdTimeStamp, 1),
  81.                     (22, :createdTimeStamp, 1)
  82.                 ;
  83.             ',
  84.             ['createdTimeStamp' => $created]
  85.         );
  86.         $this->addSql(
  87.             '
  88.                 INSERT INTO cmr_protective_gloves_material_l10n
  89.                     (language_id, parent_entity_id, name)
  90.                 VALUES
  91.                     (\'de\', 1, \'NR (0,5 mm) – Naturlatex\'),
  92.                     (\'de\', 2, \'CR (0,5 mm) – Polychloroprenlatex, Polychloropren, Chloroprene-Kautschuk, Neopren\'),
  93.                     (\'de\', 3, \'NBR (0,35 mm) – Nitrillatex, Nitrilkautschuk, Acrylnitril-Butadien-Kautschuk, Nitril\'),
  94.                     (\'de\', 4, \'Butyl (0,5 mm) – Butylkautschuk, IIR, IBR, Isobutyl-Isopren-Kautschuk\'),
  95.                     (\'de\', 5, \'FKM (0,4 mm) – Fluorkautschuk, Viton\'),
  96.                     (\'de\', 6, \'PVC (0,5 mm) – Polyvinylchlorid\'),
  97.                     (\'de\', 7, \'PE (0,03 mm) – Polyethylen (Einweghandschuhe)\'),
  98.                     (\'de\', 8, \'LLDPE – Low Level Density Polyethylen\'),
  99.                     (\'de\', 9, \'Mehrschichtenhandschuh – PE/EVAL/PE\'),
  100.                     (\'de\', 10, \'PE = Polyethylen\'),
  101.                     (\'de\', 11, \'EVAL = Ethylen-Vinylalkohol-Copolymer\'),
  102.                     (\'de\', 12, \'PVA (0,2 mm) – Polyvinylalkohol (nur bei trockenen Anwendungen)\'),
  103.                     (\'de\', 13, \'Latex/Nitril-Mix (0,4 mm) – Kombinationsmaterial für bessere Chemikalienbeständigkeit\'),
  104.                     (\'de\', 14, \'Neopren/Nitril-Mix (0,5 mm) – Hohe Beständigkeit gegen Lösungsmittel\'),
  105.                     (\'de\', 15, \'Laminat-Handschuhe (Mehrschichtfolie) – z.B. für hochtoxische Stoffe\'),
  106.                     (\'de\', 16, \'PU (0,2 mm) – Polyurethan\'),
  107.                     (\'de\', 17, \'Silikonbeschichtete Handschuhe – Für spezielle Anwendungen\'),
  108.                     (\'de\', 18, \'Textilbeschichtete Chemikalienschutzhandschuhe – z.B. mit PVC oder Nitril\'),
  109.                     (\'de\', 19, \'Viton/Butyl-Mix (0,7 mm) – Für aggressive Chemikalien\'),
  110.                     (\'de\', 20, \'Barrier-Handschuhe (z.B. 4H®) – Hochdichte Polymerfolien\'),
  111.                     (\'de\', 21, \'Einweg-Nitrilhandschuhe (0,1–0,2 mm) – Für kurzfristige Anwendungen\'),
  112.                     (\'de\', 22, \'Keine Handschuhe erforderlich / Nicht zutreffend\'),
  113.                     (\'en\', 1, null),
  114.                     (\'en\', 2, null),
  115.                     (\'en\', 3, null),
  116.                     (\'en\', 4, null),
  117.                     (\'en\', 5, null),
  118.                     (\'en\', 6, null),
  119.                     (\'en\', 7, null),
  120.                     (\'en\', 8, null),
  121.                     (\'en\', 9, null),
  122.                     (\'en\', 10, null),
  123.                     (\'en\', 11, null),
  124.                     (\'en\', 12, null),
  125.                     (\'en\', 13, null),
  126.                     (\'en\', 14, null),
  127.                     (\'en\', 15, null),
  128.                     (\'en\', 16, null),
  129.                     (\'en\', 17, null),
  130.                     (\'en\', 18, null),
  131.                     (\'en\', 19, null),
  132.                     (\'en\', 20, null),
  133.                     (\'en\', 21, null),
  134.                     (\'en\', 22, null)
  135.                 ;
  136.             '
  137.         );
  138.     }
  139.     public function down(Schema $schema): void
  140.     {
  141.         // this down() migration is auto-generated, please modify it to your needs
  142.         $this->addSql('ALTER TABLE cmr_protective_gloves_material_l10n DROP FOREIGN KEY FK_24042444706E52B3');
  143.         $this->addSql('ALTER TABLE cmr_protective_gloves_material_l10n DROP FOREIGN KEY FK_2404244482F1BAF4');
  144.         $this->addSql('DROP TABLE cmr_protective_gloves_material');
  145.         $this->addSql('DROP TABLE cmr_protective_gloves_material_l10n');
  146.     }
  147. }