migrations/Version20180920162620.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 Version20180920162620 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('
  16.             ALTER TABLE user
  17.                 ADD notify_when_mentioned TINYINT(1) NOT NULL,
  18.                 ADD notify_on_assigned_customer TINYINT(1) NOT NULL,
  19.                 ADD notify_on_assigned_lead TINYINT(1) NOT NULL,
  20.                 ADD notify_on_assigned_event TINYINT(1) NOT NULL,
  21.                 ADD notify_on_assigned_issue TINYINT(1) NOT NULL,
  22.                 ADD notify_on_assigned_feed TINYINT(1) NOT NULL,
  23.                 ADD notify_when_event_is_due TINYINT(1) NOT NULL,
  24.                 ADD notify_upcoming_event TINYINT(1) NOT NULL
  25.         ');
  26.         $this->addSql('
  27.             UPDATE user SET
  28.                 notify_when_mentioned = 1,
  29.                 notify_on_assigned_customer = 1,
  30.                 notify_on_assigned_lead = 1,
  31.                 notify_on_assigned_event = 1,
  32.                 notify_on_assigned_issue = 1,
  33.                 notify_on_assigned_feed = 1,
  34.                 notify_when_event_is_due = 1,
  35.                 notify_upcoming_event = 1
  36.         ');
  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('
  43.             ALTER TABLE user
  44.                 DROP notify_when_mentioned,
  45.                 DROP notify_on_assigned_customer,
  46.                 DROP notify_on_assigned_lead,
  47.                 DROP notify_on_assigned_event,
  48.                 DROP notify_on_assigned_issue,
  49.                 DROP notify_on_assigned_feed,
  50.                 DROP notify_when_event_is_due,
  51.                 DROP notify_upcoming_event
  52.         ');
  53.     }
  54. }