<?php
declare(strict_types=1);
namespace DoctrineMigrations;
use Doctrine\DBAL\Schema\Schema;
use Doctrine\Migrations\AbstractMigration;
final class Version20211020100344 extends AbstractMigration
{
public function getDescription(): string
{
return 'Search Owner update';
}
public function up(Schema $schema): void
{
$this->addSql('ALTER TABLE cat ADD deleted TINYINT(1) NOT NULL');
$this->addSql('ALTER TABLE search_owner DROP FOREIGN KEY FK_FB552595E6ADA943');
$this->addSql('DROP INDEX IDX_FB552595E6ADA943 ON search_owner');
$this->addSql('ALTER TABLE search_owner ADD cats LONGTEXT NOT NULL COMMENT \'(DC2Type:array)\', DROP cat_id');
}
public function down(Schema $schema): void
{
$this->addSql('ALTER TABLE cat DROP deleted');
$this->addSql('ALTER TABLE search_owner ADD cat_id INT DEFAULT NULL, DROP cats');
$this->addSql('ALTER TABLE search_owner ADD CONSTRAINT FK_FB552595E6ADA943 FOREIGN KEY (cat_id) REFERENCES cat (id) ON UPDATE NO ACTION ON DELETE NO ACTION');
$this->addSql('CREATE INDEX IDX_FB552595E6ADA943 ON search_owner (cat_id)');
}
public function isTransactional(): bool
{
return false;
}
}