<?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 Version20180920162620 extends AbstractMigration
{
public function up(Schema $schema): void
{
// this up() migration is auto-generated, please modify it to your needs
$this->abortIf('mysql' !== $this->connection->getDatabasePlatform()->getName(), 'Migration can only be executed safely on \'mysql\'.');
$this->addSql('
ALTER TABLE user
ADD notify_when_mentioned TINYINT(1) NOT NULL,
ADD notify_on_assigned_customer TINYINT(1) NOT NULL,
ADD notify_on_assigned_lead TINYINT(1) NOT NULL,
ADD notify_on_assigned_event TINYINT(1) NOT NULL,
ADD notify_on_assigned_issue TINYINT(1) NOT NULL,
ADD notify_on_assigned_feed TINYINT(1) NOT NULL,
ADD notify_when_event_is_due TINYINT(1) NOT NULL,
ADD notify_upcoming_event TINYINT(1) NOT NULL
');
$this->addSql('
UPDATE user SET
notify_when_mentioned = 1,
notify_on_assigned_customer = 1,
notify_on_assigned_lead = 1,
notify_on_assigned_event = 1,
notify_on_assigned_issue = 1,
notify_on_assigned_feed = 1,
notify_when_event_is_due = 1,
notify_upcoming_event = 1
');
}
public function down(Schema $schema): void
{
// this down() migration is auto-generated, please modify it to your needs
$this->abortIf('mysql' !== $this->connection->getDatabasePlatform()->getName(), 'Migration can only be executed safely on \'mysql\'.');
$this->addSql('
ALTER TABLE user
DROP notify_when_mentioned,
DROP notify_on_assigned_customer,
DROP notify_on_assigned_lead,
DROP notify_on_assigned_event,
DROP notify_on_assigned_issue,
DROP notify_on_assigned_feed,
DROP notify_when_event_is_due,
DROP notify_upcoming_event
');
}
}