<?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 Version20220803161729 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 brand DROP slug, DROP woo_commerce_id, DROP slug_alt, DROP woo_commerce_id_alt');
$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');
$this->addSql('ALTER TABLE template ADD CONSTRAINT FK_97601F8312469DE2 FOREIGN KEY (category_id) REFERENCES brand (id)');
$this->addSql('CREATE INDEX IDX_97601F8312469DE2 ON template (category_id)');
}
public function down(Schema $schema): void
{
// this down() migration is auto-generated, please modify it to your needs
$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');
$this->addSql('ALTER TABLE template DROP FOREIGN KEY FK_97601F8312469DE2');
$this->addSql('DROP INDEX IDX_97601F8312469DE2 ON template');
$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');
}
}