<?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 Version20220713085150 extends AbstractMigration
{
public function getDescription(): string
{
return 'Updated notification tables';
}
public function up(Schema $schema): void
{
$this->addSql("alter table notification_customer_setting add email int;");
$this->addSql("alter table notification_customer_setting add sms int;");
$this->addSql("alter table notification_customer_setting add profile int;");
$this->addSql("UPDATE notification_customer_setting SET sms = ((notification_method & 1) != 0), email = ((notification_method & 2) != 0), profile = ((notification_method & 4) != 0)");
$this->addSql("alter table notification_customer_setting drop column notification_method;");
}
public function down(Schema $schema): void
{
}
}