migrations/Version20181217170223.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 Version20181217170223 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 customer_status ADD type ENUM(\'default\', \'converted\', \'closed\', \'in_collections\', \'stop_work\', \'cancelled\', \'inactive\', \'waiting_on_poa\', \'pending\') DEFAULT NULL COMMENT \'(DC2Type:StatusType)\'');
  16.         $this->addSql('UPDATE customer_status SET type = \'default\' WHERE id = 1');
  17.         $this->addSql('UPDATE customer_status SET type = \'converted\' WHERE id = 2');
  18.         $this->addSql('UPDATE customer_status SET type = \'closed\' WHERE id = 5');
  19.         $this->addSql('UPDATE customer_status SET type = \'in_collections\' WHERE id = 6');
  20.         $this->addSql('UPDATE customer_status SET type = \'stop_work\' WHERE id = 7');
  21.         $this->addSql('UPDATE customer_status SET type = \'cancelled\' WHERE id = 8');
  22.         $this->addSql('UPDATE customer_status SET type = \'inactive\' WHERE id = 9');
  23.         $this->addSql('UPDATE customer_status SET type = \'waiting_on_poa\' WHERE id = 10');
  24.         $this->addSql('UPDATE customer_status SET type = \'pending\' WHERE id = 11');
  25.     }
  26.     public function down(Schema $schema): void
  27.     {
  28.         // this down() migration is auto-generated, please modify it to your needs
  29.         $this->abortIf('mysql' !== $this->connection->getDatabasePlatform()->getName(), 'Migration can only be executed safely on \'mysql\'.');
  30.         $this->addSql('ALTER TABLE customer_status DROP type');
  31.     }
  32. }