<?php
declare(strict_types=1);
namespace DoctrineMigrations;
use Doctrine\DBAL\Schema\Schema;
use Doctrine\Migrations\AbstractMigration;
final class Version20240925081546 extends AbstractMigration
{
public function getDescription(): string
{
return "Change displayNotes field's to true default value & update all products's displayNotes field value to true";
}
public function up(Schema $schema): void
{
$this->addSql('ALTER TABLE product CHANGE display_notes display_notes TINYINT(1) DEFAULT 1 NOT NULL');
$this->addSql('UPDATE product SET display_notes = true');
}
public function down(Schema $schema): void
{
$this->addSql('ALTER TABLE product CHANGE display_notes display_notes TINYINT(1) DEFAULT 0 NOT NULL');
$this->addSql('UPDATE product SET display_notes = false');
}
}