<?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 Version20221206134855 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('DROP TABLE migration_versions');
// $this->addSql('ALTER TABLE classification__category DROP FOREIGN KEY FK_43629B36EA9FDD75');
// $this->addSql('DROP INDEX IDX_43629B36EA9FDD75 ON classification__category');
$this->addSql('ALTER TABLE classification__category CHANGE newsletterFrom newslettersFrom VARCHAR(255) DEFAULT NULL');
$this->addSql('UPDATE `media__media` SET `cdn_is_flushable` = 0 where `cdn_is_flushable` is NULL');
// $this->addSql('ALTER TABLE classification__collection DROP FOREIGN KEY FK_A406B56AEA9FDD75');
// $this->addSql('DROP INDEX IDX_A406B56AEA9FDD75 ON classification__collection');
// $this->addSql('ALTER TABLE classification__collection DROP media_id, CHANGE context context INT DEFAULT NULL');
// $this->addSql('ALTER TABLE classification__context CHANGE id id INT AUTO_INCREMENT NOT NULL');
// $this->addSql('ALTER TABLE classification__tag CHANGE context context INT DEFAULT NULL');
}
public function down(Schema $schema): void
{
// this down() migration is auto-generated, please modify it to your needs
// $this->addSql('CREATE TABLE migration_versions (version VARCHAR(255) CHARACTER SET utf8 NOT NULL COLLATE `utf8_unicode_ci`, PRIMARY KEY(version)) DEFAULT CHARACTER SET utf8 COLLATE `utf8_unicode_ci` ENGINE = InnoDB COMMENT = \'\' ');
$this->addSql('ALTER TABLE classification__category CHANGE newslettersFrom newsletterFrom VARCHAR(255) DEFAULT NULL');
$this->addSql('UPDATE `media__media` SET `cdn_is_flushable` = NULL where `cdn_is_flushable` = 0');
// $this->addSql('ALTER TABLE classification__category ADD CONSTRAINT FK_43629B36EA9FDD75 FOREIGN KEY (media_id) REFERENCES media__media (id) ON DELETE SET NULL');
// $this->addSql('CREATE INDEX IDX_43629B36EA9FDD75 ON classification__category (media_id)');
// $this->addSql('ALTER TABLE classification__collection ADD media_id INT DEFAULT NULL, CHANGE context context VARCHAR(255) DEFAULT NULL');
// $this->addSql('ALTER TABLE classification__collection ADD CONSTRAINT FK_A406B56AEA9FDD75 FOREIGN KEY (media_id) REFERENCES media__media (id) ON DELETE SET NULL');
// $this->addSql('CREATE INDEX IDX_A406B56AEA9FDD75 ON classification__collection (media_id)');
// $this->addSql('ALTER TABLE classification__context CHANGE id id VARCHAR(255) NOT NULL');
// $this->addSql('ALTER TABLE classification__tag CHANGE context context VARCHAR(255) DEFAULT NULL');
}
}