<?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 Version20260127105712 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_work_activity (
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\',
PRIMARY KEY(id)
) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB
'
);
$this->addSql(
'
CREATE TABLE cmr_work_activity_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)\',
name VARCHAR(225) DEFAULT NULL COMMENT \'Work activity name in referenced language\',
INDEX IDX_24F228C1706E52B3 (parent_entity_id),
INDEX IDX_24F228C182F1BAF4 (language_id),
PRIMARY KEY(parent_entity_id, language_id)
) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB
'
);
$this->addSql(
'
ALTER TABLE cmr_work_activity_l10n ADD CONSTRAINT FK_24F228C1706E52B3 FOREIGN KEY
(parent_entity_id) REFERENCES cmr_work_activity (id) ON DELETE CASCADE
'
);
$this->addSql(
'
ALTER TABLE cmr_work_activity_l10n ADD CONSTRAINT FK_24F228C182F1BAF4 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 cmr_work_activity
(id, created, active)
VALUES
(1, :createdTimeStamp, 1),
(2, :createdTimeStamp, 1),
(3, :createdTimeStamp, 1),
(4, :createdTimeStamp, 1),
(5, :createdTimeStamp, 1),
(6, :createdTimeStamp, 1),
(7, :createdTimeStamp, 1),
(8, :createdTimeStamp, 1),
(9, :createdTimeStamp, 1),
(10, :createdTimeStamp, 1),
(11, :createdTimeStamp, 1),
(12, :createdTimeStamp, 1),
(13, :createdTimeStamp, 1),
(14, :createdTimeStamp, 1),
(15, :createdTimeStamp, 1),
(16, :createdTimeStamp, 1),
(17, :createdTimeStamp, 1),
(18, :createdTimeStamp, 1),
(19, :createdTimeStamp, 1),
(20, :createdTimeStamp, 1),
(-1, :createdTimeStamp, 1)
;
',
['createdTimeStamp' => $created]
);
$this->addSql(
'
INSERT INTO cmr_work_activity_l10n
(language_id, parent_entity_id, name)
VALUES
(\'de\', 1, \'Laboranalytik / Chemische Untersuchung.\'),
(\'de\', 2, \'Produktion / Herstellung chemischer Produkte.\'),
(\'de\', 3, \'Lackierung / Beschichtung.\'),
(\'de\', 4, \'Reinigung / Entfettung mit Lösemitteln.\'),
(\'de\', 5, \'Wartung / Instandhaltung von Anlagen.\'),
(\'de\', 6, \'Abfüllung / Verpackung von Gefahrstoffen.\'),
(\'de\', 7, \'Entsorgung / Recycling gefährlicher Stoffe.\'),
(\'de\', 8, \'Transport / Logistik von Gefahrstoffen.\'),
(\'de\', 9, \'Forschung & Entwicklung.\'),
(\'de\', 10, \'Qualitätssicherung / Prüflabor.\'),
(\'de\', 11, \'Arbeit in der Metallverarbeitung (z.B. . Schweißen, Löten).\'),
(\'de\', 12, \'Arbeit in der Kunststoffverarbeitung.\'),
(\'de\', 13, \'Arbeit in der pharmazeutischen Produktion.\'),
(\'de\', 14, \'Arbeit in der Druckindustrie.\'),
(\'de\', 15, \'Arbeit in der Textilindustrie.\'),
(\'de\', 16, \'Arbeit in der Baustoffindustrie (z.B. Asbest, Quarzstaub).\'),
(\'de\', 17, \'Arbeit in der Abwasserbehandlung / Kläranlage.\'),
(\'de\', 18, \'Arbeit in der Abfallwirtschaft.\'),
(\'de\', 19, \'Arbeit in der Landwirtschaft / Pflanzenschutz.\'),
(\'de\', 20, \'Arbeit in der Medizin / Pathologie / Histologie.\'),
(\'de\', -1, \'Andere\'),
(\'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\', -1, \'Other\')
;
'
);
}
public function down(Schema $schema): void
{
// this down() migration is auto-generated, please modify it to your needs
$this->addSql('ALTER TABLE cmr_work_activity_l10n DROP FOREIGN KEY FK_24F228C182F1BAF4');
$this->addSql('ALTER TABLE cmr_work_activity_l10n DROP FOREIGN KEY FK_24F228C1706E52B3');
$this->addSql('DROP TABLE cmr_work_activity_l10n');
$this->addSql('DROP TABLE cmr_work_activity');
}
}