<?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 Version20220821105451 extends AbstractMigration
{
public function getDescription(): string
{
return '';
}
public function up(Schema $schema): void
{
// this up() migration is auto-generated, please modify it to your needs
$this->addSql('ALTER TABLE material ADD name_trans JSON DEFAULT NULL, ADD description_trans JSON DEFAULT NULL, ADD short_description_trans JSON DEFAULT NULL');
$this->addSql('UPDATE material SET name_trans = \'[]\' WHERE name_trans IS NULL');
$this->addSql('UPDATE material SET description_trans = \'[]\' WHERE description_trans IS NULL');
$this->addSql('UPDATE material SET short_description_trans = \'[]\' WHERE short_description_trans IS NULL');
$this->addSql('ALTER TABLE material_variation ADD name_trans JSON DEFAULT NULL, ADD description_trans JSON DEFAULT NULL, ADD short_description_trans JSON DEFAULT NULL');
$this->addSql('UPDATE material_variation SET name_trans = \'[]\' WHERE name_trans IS NULL');
$this->addSql('UPDATE material_variation SET description_trans = \'[]\' WHERE description_trans IS NULL');
$this->addSql('UPDATE material_variation SET short_description_trans = \'[]\' WHERE short_description_trans IS NULL');
$this->addSql('ALTER TABLE packaging_type ADD name_trans JSON DEFAULT NULL, ADD description_trans JSON DEFAULT NULL, ADD short_description_trans JSON DEFAULT NULL');
$this->addSql('UPDATE packaging_type SET name_trans = \'[]\' WHERE name_trans IS NULL');
$this->addSql('UPDATE packaging_type SET description_trans = \'[]\' WHERE description_trans IS NULL');
$this->addSql('UPDATE packaging_type SET short_description_trans = \'[]\' WHERE short_description_trans IS NULL');
$this->addSql('ALTER TABLE pouch_option ADD name_trans JSON DEFAULT NULL, ADD description_trans JSON DEFAULT NULL, ADD short_description_trans JSON DEFAULT NULL, ADD is_visible_in_web_constructor TINYINT(1) NOT NULL');
$this->addSql('UPDATE pouch_option SET name_trans = \'[]\' WHERE name_trans IS NULL');
$this->addSql('UPDATE pouch_option SET description_trans = \'[]\' WHERE description_trans IS NULL');
$this->addSql('UPDATE pouch_option SET short_description_trans = \'[]\' WHERE short_description_trans IS NULL');
}
public function down(Schema $schema): void
{
// this down() migration is auto-generated, please modify it to your needs
$this->addSql('ALTER TABLE material DROP name_trans, DROP description_trans, DROP short_description_trans');
$this->addSql('ALTER TABLE material_variation DROP name_trans, DROP description_trans, DROP short_description_trans');
$this->addSql('ALTER TABLE packaging_type DROP name_trans, DROP description_trans, DROP short_description_trans');
$this->addSql('ALTER TABLE pouch_option DROP name_trans, DROP description_trans, DROP short_description_trans, DROP is_visible_in_web_constructor');
}
}