<?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 Version20220707194857 extends AbstractMigration
{
public function getDescription(): string
{
return 'Adjustment default columns to zero in notification_template';
}
public function up(Schema $schema): void
{
$this->addSql("UPDATE notification_template SET setting = 0 WHERE setting IS NULL and profile_default IS NOT NULL;");
$this->addSql("UPDATE notification_template SET profile_default = 0 WHERE profile_default IS NULL AND setting IS NOT NULL;");
$this->addSql("UPDATE notification_template SET setting = 0, profile_default = 7 WHERE profile_default IS NULL AND setting IS NULL;");
$this->addSql('ALTER TABLE notification_template MODIFY COLUMN setting INT DEFAULT 0 NOT NULL;');
$this->addSql('ALTER TABLE notification_template MODIFY COLUMN profile_default INT DEFAULT 0 NOT NULL;');
}
}