<?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 Version20231113084737 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
//ALTER TABLE
$this->addSql('ALTER TABLE email CHANGE parameters parameters LONGTEXT NOT NULL COLLATE `utf8mb4_bin` COMMENT \'(DC2Type:json)\'');
$this->addSql('ALTER TABLE `order`
CHANGE delivery_address_copy_emails delivery_address_copy_emails LONGTEXT NOT NULL COLLATE `utf8mb4_bin` COMMENT \'(DC2Type:json)\',
CHANGE delivery_address_blind_copy_emails delivery_address_blind_copy_emails LONGTEXT NOT NULL COLLATE `utf8mb4_bin` COMMENT \'(DC2Type:json)\',
CHANGE billing_address_copy_emails billing_address_copy_emails LONGTEXT NOT NULL COLLATE `utf8mb4_bin` COMMENT \'(DC2Type:json)\',
CHANGE billing_address_blind_copy_emails billing_address_blind_copy_emails LONGTEXT NOT NULL COLLATE `utf8mb4_bin` COMMENT \'(DC2Type:json)\',
CHANGE main_address_copy_emails main_address_copy_emails LONGTEXT NOT NULL COLLATE `utf8mb4_bin` COMMENT \'(DC2Type:json)\',
CHANGE main_address_blind_copy_emails main_address_blind_copy_emails LONGTEXT NOT NULL COLLATE `utf8mb4_bin` COMMENT \'(DC2Type:json)\'
');
$this->addSql('ALTER TABLE point_transfer ADD comment VARCHAR(255) DEFAULT NULL');
$this->addSql('ALTER TABLE shop_product CHANGE to_edit to_edit TINYINT(1) DEFAULT 0 NOT NULL');
$this->addSql('ALTER TABLE supplier_product CHANGE shipping_costs shipping_costs INT DEFAULT 0 NOT NULL');
//FOREIGN KEY DROP
$this->addSql('ALTER TABLE shop_product DROP FOREIGN KEY FK_D07944872ADD6D8C');
$this->addSql('ALTER TABLE supplier_brand DROP FOREIGN KEY FK_C549FB722ADD6D8C');
$this->addSql('ALTER TABLE supplier_product DROP FOREIGN KEY FK_522F70B22ADD6D8C');
$this->addSql('ALTER TABLE supplier_taxonomy DROP FOREIGN KEY FK_709BD0BC2ADD6D8C');
//FOREIGN KEY ADD
$this->addSql('ALTER TABLE shop_product ADD CONSTRAINT FK_D07944872ADD6D8C FOREIGN KEY (supplier_id) REFERENCES company (id)');
$this->addSql('ALTER TABLE supplier_brand ADD CONSTRAINT FK_C549FB722ADD6D8C FOREIGN KEY (supplier_id) REFERENCES company (id)');
$this->addSql('ALTER TABLE supplier_product ADD CONSTRAINT FK_522F70B22ADD6D8C FOREIGN KEY (supplier_id) REFERENCES company (id)');
$this->addSql('ALTER TABLE supplier_taxonomy ADD CONSTRAINT FK_709BD0BC2ADD6D8C FOREIGN KEY (supplier_id) REFERENCES company (id)');
//DROP INDEX
$this->addSql('DROP INDEX `supplier_id reference` ON shop_product');
$this->addSql('DROP INDEX `supplier_id state` ON shop_product');
$this->addSql('DROP INDEX `name supplier_id` ON supplier_brand');
$this->addSql('DROP INDEX `new supplier_id` ON supplier_product');
$this->addSql('DROP INDEX `hash supplier_id` ON supplier_taxonomy');
//CREATE INDEX
$this->addSql('CREATE INDEX supplier_id_reference ON shop_product (supplier_id, `reference`)');
$this->addSql('CREATE INDEX supplier_id_state ON shop_product (supplier_id, state)');
$this->addSql('CREATE INDEX name_supplier_id ON supplier_brand (name, supplier_id)');
$this->addSql('CREATE INDEX new_supplier_id ON supplier_product (new, supplier_id)');
$this->addSql('CREATE INDEX hash_supplier_id ON supplier_taxonomy (hash, supplier_id)');
}
public function down(Schema $schema): void
{
// this down() migration is auto-generated, please modify it to your needs
//ALTER TABLE
$this->addSql('ALTER TABLE email CHANGE parameters parameters LONGTEXT NOT NULL COLLATE `utf8mb4_bin`');
$this->addSql('ALTER TABLE `order` CHANGE delivery_address_copy_emails delivery_address_copy_emails LONGTEXT NOT NULL COLLATE `utf8mb4_bin`, CHANGE delivery_address_blind_copy_emails delivery_address_blind_copy_emails LONGTEXT NOT NULL COLLATE `utf8mb4_bin`, CHANGE billing_address_copy_emails billing_address_copy_emails LONGTEXT NOT NULL COLLATE `utf8mb4_bin`, CHANGE billing_address_blind_copy_emails billing_address_blind_copy_emails LONGTEXT NOT NULL COLLATE `utf8mb4_bin`, CHANGE main_address_copy_emails main_address_copy_emails LONGTEXT NOT NULL COLLATE `utf8mb4_bin`, CHANGE main_address_blind_copy_emails main_address_blind_copy_emails LONGTEXT NOT NULL COLLATE `utf8mb4_bin`');
$this->addSql('ALTER TABLE `point_transfer` DROP comment');
$this->addSql('ALTER TABLE shop_product CHANGE to_edit to_edit TINYINT(1) DEFAULT FALSE NOT NULL');
$this->addSql('ALTER TABLE supplier_product CHANGE shipping_costs shipping_costs INT NOT NULL');
//FOREIGN KEY DROP
$this->addSql('ALTER TABLE `shop_product` DROP FOREIGN KEY FK_D07944872ADD6D8C');
$this->addSql('ALTER TABLE supplier_brand DROP FOREIGN KEY FK_C549FB722ADD6D8C');
$this->addSql('ALTER TABLE supplier_taxonomy DROP FOREIGN KEY FK_709BD0BC2ADD6D8C');
$this->addSql('ALTER TABLE `supplier_product` DROP FOREIGN KEY FK_522F70B22ADD6D8C');
//FOREIGN KEY ADD
$this->addSql('ALTER TABLE `shop_product` ADD CONSTRAINT FK_D07944872ADD6D8C FOREIGN KEY (supplier_id) REFERENCES company (id)');
$this->addSql('ALTER TABLE supplier_brand ADD CONSTRAINT FK_C549FB722ADD6D8C FOREIGN KEY (supplier_id) REFERENCES company (id)');
$this->addSql('ALTER TABLE supplier_taxonomy ADD CONSTRAINT FK_709BD0BC2ADD6D8C FOREIGN KEY (supplier_id) REFERENCES company (id)');
$this->addSql('ALTER TABLE `supplier_product` ADD CONSTRAINT FK_522F70B22ADD6D8C FOREIGN KEY (supplier_id) REFERENCES company (id)');
//DROP INDEX
$this->addSql('DROP INDEX supplier_id_reference ON `shop_product`');
$this->addSql('DROP INDEX supplier_id_state ON `shop_product`');
$this->addSql('DROP INDEX name_supplier_id ON supplier_brand');
$this->addSql('DROP INDEX hash_supplier_id ON supplier_taxonomy');
$this->addSql('DROP INDEX new_supplier_id ON `supplier_product`');
//CREATE INDEX
$this->addSql('CREATE INDEX `supplier_id reference` ON `shop_product` (supplier_id, reference)');
$this->addSql('CREATE INDEX `supplier_id state` ON `shop_product` (supplier_id, state)');
$this->addSql('CREATE INDEX `name supplier_id` ON supplier_brand (name, supplier_id)');
$this->addSql('CREATE INDEX `hash supplier_id` ON supplier_taxonomy (hash, supplier_id)');
$this->addSql('CREATE INDEX `new supplier_id` ON `supplier_product` (new, supplier_id)');
}
}