migrations/Version20220803161729.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. /**
  7.  * Auto-generated Migration: Please modify to your needs!
  8.  */
  9. final class Version20220803161729 extends AbstractMigration
  10. {
  11.     public function getDescription(): string
  12.     {
  13.         return '';
  14.     }
  15.     public function up(Schema $schema): void
  16.     {
  17.         // this up() migration is auto-generated, please modify it to your needs
  18.         $this->addSql('ALTER TABLE brand DROP slug, DROP woo_commerce_id, DROP slug_alt, DROP woo_commerce_id_alt');
  19.         $this->addSql('ALTER TABLE template ADD category_id VARCHAR(255) DEFAULT NULL, ADD model VARCHAR(255) NOT NULL, ADD model_alt VARCHAR(255) DEFAULT NULL, DROP sku, DROP name, DROP name_alt, DROP short_description, DROP short_description_alt, DROP regular_price');
  20.         $this->addSql('ALTER TABLE template ADD CONSTRAINT FK_97601F8312469DE2 FOREIGN KEY (category_id) REFERENCES brand (id)');
  21.         $this->addSql('CREATE INDEX IDX_97601F8312469DE2 ON template (category_id)');
  22.     }
  23.     public function down(Schema $schema): void
  24.     {
  25.         // this down() migration is auto-generated, please modify it to your needs
  26.         $this->addSql('ALTER TABLE brand ADD slug VARCHAR(80) NOT NULL, ADD woo_commerce_id INT DEFAULT NULL, ADD slug_alt VARCHAR(80) DEFAULT NULL, ADD woo_commerce_id_alt INT DEFAULT NULL');
  27.         $this->addSql('ALTER TABLE template DROP FOREIGN KEY FK_97601F8312469DE2');
  28.         $this->addSql('DROP INDEX IDX_97601F8312469DE2 ON template');
  29.         $this->addSql('ALTER TABLE template ADD sku VARCHAR(255) DEFAULT NULL, ADD name_alt VARCHAR(255) DEFAULT NULL, ADD short_description VARCHAR(255) NOT NULL, ADD short_description_alt VARCHAR(255) DEFAULT NULL, ADD regular_price DOUBLE PRECISION DEFAULT NULL, DROP category_id, DROP model_alt, CHANGE model name VARCHAR(255) NOT NULL');
  30.     }
  31. }