migrations/Version20211020100344.php line 1

Open in your IDE?
  1. <?php
  2. declare(strict_types=1);
  3. namespace DoctrineMigrations;
  4. use Doctrine\DBAL\Schema\Schema;
  5. use Doctrine\Migrations\AbstractMigration;
  6. final class Version20211020100344 extends AbstractMigration
  7. {
  8.     public function getDescription(): string
  9.     {
  10.         return 'Search Owner update';
  11.     }
  12.     public function up(Schema $schema): void
  13.     {
  14.         $this->addSql('ALTER TABLE cat ADD deleted TINYINT(1) NOT NULL');
  15.         $this->addSql('ALTER TABLE search_owner DROP FOREIGN KEY FK_FB552595E6ADA943');
  16.         $this->addSql('DROP INDEX IDX_FB552595E6ADA943 ON search_owner');
  17.         $this->addSql('ALTER TABLE search_owner ADD cats LONGTEXT NOT NULL COMMENT \'(DC2Type:array)\', DROP cat_id');
  18.     }
  19.     public function down(Schema $schema): void
  20.     {
  21.         $this->addSql('ALTER TABLE cat DROP deleted');
  22.         $this->addSql('ALTER TABLE search_owner ADD cat_id INT DEFAULT NULL, DROP cats');
  23.         $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');
  24.         $this->addSql('CREATE INDEX IDX_FB552595E6ADA943 ON search_owner (cat_id)');
  25.     }
  26.     public function isTransactional(): bool
  27.     {
  28.         return false;
  29.     }
  30. }