migrations/Version20211104080824.php line 1

Open in your IDE?
  1. <?php
  2. declare(strict_types=1);
  3. namespace Application\Migrations;
  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 Version20211104080824 extends AbstractMigration
  10. {
  11.     public function up(Schema $schema): void
  12.     {
  13.         // this up() migration is auto-generated, please modify it to your needs
  14.         $this->abortIf('mysql' !== $this->connection->getDatabasePlatform()->getName(), 'Migration can only be executed safely on \'mysql\'.');
  15.         $this->addSql('ALTER TABLE substance_category ADD abbreviation VARCHAR(255) NOT NULL');
  16.         $this->addSql("UPDATE `substance_category` SET `abbreviation` = 'OtherGO' WHERE `substance_category`.`id` = 1");
  17.         $this->addSql("UPDATE `substance_category` SET `abbreviation` = 'TDAE' WHERE `substance_category`.`id` = 2");
  18.         $this->addSql("UPDATE `substance_category` SET `abbreviation` = 'VHGO' WHERE `substance_category`.`id` = 3");
  19.         $this->addSql("UPDATE `substance_category` SET `abbreviation` = 'SRGO' WHERE `substance_category`.`id` = 4");
  20.         $this->addSql("UPDATE `substance_category` SET `abbreviation` = 'Petrolatum' WHERE `substance_category`.`id` = 5");
  21.         $this->addSql("UPDATE `substance_category` SET `abbreviation` = 'LBO' WHERE `substance_category`.`id` = 6");
  22.         $this->addSql("UPDATE `substance_category` SET `abbreviation` = 'Bitumen' WHERE `substance_category`.`id` = 7");
  23.         $this->addSql("UPDATE `substance_category` SET `abbreviation` = 'Slackwax' WHERE `substance_category`.`id` = 8");
  24.         $this->addSql("UPDATE `substance_category` SET `abbreviation` = 'Naphtha' WHERE `substance_category`.`id` = 9");
  25.         $this->addSql("UPDATE `substance_category` SET `abbreviation` = 'HFO' WHERE `substance_category`.`id` = 10");
  26.         $this->addSql("UPDATE `substance_category` SET `abbreviation` = 'Kerosine' WHERE `substance_category`.`id` = 11");
  27.         $this->addSql("UPDATE `substance_category` SET `abbreviation` = 'CrackedGO' WHERE `substance_category`.`id` = 12");
  28.         $this->addSql("UPDATE `substance_category` SET `abbreviation` = 'Paraffinwax' WHERE `substance_category`.`id` = 14");
  29.         $this->addSql("UPDATE `substance_category` SET `abbreviation` = 'UATO' WHERE `substance_category`.`id` = 15");
  30.         $this->addSql("UPDATE `substance_category` SET `abbreviation` = 'UDAE' WHERE `substance_category`.`id` = 17");
  31.         $this->addSql("UPDATE `substance_category` SET `abbreviation` = 'RAE' WHERE `substance_category`.`id` = 18");
  32.         $this->addSql("UPDATE `substance_category` SET `abbreviation` = 'MK1' WHERE `substance_category`.`id` = 19");
  33.         $this->addSql("UPDATE `substance_category` SET `abbreviation` = 'Footsoil' WHERE `substance_category`.`id` = 20");
  34.         $this->addSql("UPDATE `substance_category` SET `abbreviation` = 'OxiAsph' WHERE `substance_category`.`id` = 21");
  35.         $this->addSql("UPDATE `substance_category` SET `abbreviation` = 'Sulfur' WHERE `substance_category`.`id` = 22");
  36.         $this->addSql("UPDATE `substance_category` SET `abbreviation` = 'HRBO' WHERE `substance_category`.`id` = 23");
  37.     }
  38.     public function down(Schema $schema): void
  39.     {
  40.         // this down() migration is auto-generated, please modify it to your needs
  41.         $this->abortIf('mysql' !== $this->connection->getDatabasePlatform()->getName(), 'Migration can only be executed safely on \'mysql\'.');
  42.         $this->addSql('ALTER TABLE substance_category DROP abbreviation');
  43.     }
  44. }