<?php
declare(strict_types=1);
namespace CoreMigrations;
use Doctrine\DBAL\Schema\Schema;
use Doctrine\Migrations\AbstractMigration;
/**
* Auto-generated Migration: Please modify to your needs!
*/
final class Version20221011083340 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('CREATE TABLE products_bundle__brand_context (id BINARY(16) NOT NULL COMMENT \'(DC2Type:uuid)\', brand_id BINARY(16) NOT NULL COMMENT \'(DC2Type:uuid)\', context_id BINARY(16) NOT NULL COMMENT \'(DC2Type:uuid)\', INDEX IDX_238239EF44F5D008 (brand_id), INDEX IDX_238239EF6B00C1CF (context_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB');
$this->addSql('ALTER TABLE products_bundle__brand_context ADD CONSTRAINT FK_238239EF44F5D008 FOREIGN KEY (brand_id) REFERENCES products_bundle__brand (id)');
$this->addSql('ALTER TABLE products_bundle__brand_context ADD CONSTRAINT FK_238239EF6B00C1CF FOREIGN KEY (context_id) REFERENCES context (id)');
$this->addSql('ALTER TABLE customers_bundle__customer ADD relay_number VARCHAR(255) DEFAULT NULL');
$this->addSql('ALTER TABLE import_products_bundle__import_error CHANGE options options LONGTEXT NOT NULL COMMENT \'(DC2Type:json)\'');
$this->addSql('ALTER TABLE labels_bundle__label CHANGE summary summary LONGTEXT DEFAULT NULL');
$this->addSql('ALTER TABLE products_bundle__product CHANGE summary summary LONGTEXT DEFAULT NULL');
$this->addSql('ALTER TABLE sales_bundle__credit_note CHANGE options options LONGTEXT NOT NULL COMMENT \'(DC2Type:json)\'');
$this->addSql('ALTER TABLE sales_bundle__credit_note_line CHANGE options options LONGTEXT NOT NULL COMMENT \'(DC2Type:json)\'');
$this->addSql('ALTER TABLE sales_bundle__delivery_note CHANGE options options LONGTEXT NOT NULL COMMENT \'(DC2Type:json)\'');
$this->addSql('ALTER TABLE sales_bundle__delivery_note_line CHANGE options options LONGTEXT NOT NULL COMMENT \'(DC2Type:json)\'');
$this->addSql('ALTER TABLE sales_bundle__invoice CHANGE options options LONGTEXT NOT NULL COMMENT \'(DC2Type:json)\'');
$this->addSql('ALTER TABLE sales_bundle__invoice_line CHANGE options options LONGTEXT NOT NULL COMMENT \'(DC2Type:json)\'');
$this->addSql('ALTER TABLE sales_bundle__order CHANGE options options LONGTEXT NOT NULL COMMENT \'(DC2Type:json)\'');
$this->addSql('ALTER TABLE sales_bundle__order_line CHANGE options options LONGTEXT NOT NULL COMMENT \'(DC2Type:json)\'');
$this->addSql('ALTER TABLE sales_bundle__quotation ADD payment_method_id BINARY(16) DEFAULT NULL COMMENT \'(DC2Type:uuid)\', ADD validity_in_days INT DEFAULT NULL, CHANGE options options LONGTEXT NOT NULL COMMENT \'(DC2Type:json)\'');
$this->addSql('ALTER TABLE sales_bundle__quotation ADD CONSTRAINT FK_A0FC50DF5AA1164F FOREIGN KEY (payment_method_id) REFERENCES sales_bundle__payment_method (id)');
$this->addSql('CREATE INDEX IDX_A0FC50DF5AA1164F ON sales_bundle__quotation (payment_method_id)');
$this->addSql('ALTER TABLE sales_bundle__quotation_line CHANGE options options LONGTEXT NOT NULL COMMENT \'(DC2Type:json)\'');
$this->addSql('ALTER TABLE shipments_bundle__carrier ADD is_relay TINYINT(1) DEFAULT 0');
$this->addSql('ALTER TABLE shipments_bundle__order_options ADD length NUMERIC(20, 6) DEFAULT NULL, ADD width NUMERIC(20, 6) DEFAULT NULL, ADD height NUMERIC(20, 6) DEFAULT NULL');
$this->addSql('ALTER TABLE stocks_bundle__stock_location ADD quantity_available INT NOT NULL');
$this->addSql('ALTER TABLE stocks_bundle__stock_product ADD quantity_available INT NOT NULL');
$this->addSql('ALTER TABLE suppliers_orders_bundle__receipt_note CHANGE options options LONGTEXT NOT NULL COMMENT \'(DC2Type:json)\'');
$this->addSql('ALTER TABLE suppliers_orders_bundle__receipt_note_line CHANGE options options LONGTEXT NOT NULL COMMENT \'(DC2Type:json)\'');
$this->addSql('ALTER TABLE suppliers_orders_bundle__supplier_order_line CHANGE options options LONGTEXT NOT NULL COMMENT \'(DC2Type:json)\'');
}
public function down(Schema $schema): void
{
// this down() migration is auto-generated, please modify it to your needs
$this->addSql('DROP TABLE products_bundle__brand_context');
$this->addSql('ALTER TABLE customers_bundle__customer DROP relay_number');
$this->addSql('ALTER TABLE import_products_bundle__import_error CHANGE options options LONGTEXT NOT NULL COLLATE `utf8mb4_bin`');
$this->addSql('ALTER TABLE labels_bundle__label CHANGE summary summary VARCHAR(255) DEFAULT NULL');
$this->addSql('ALTER TABLE products_bundle__product CHANGE summary summary VARCHAR(255) DEFAULT NULL');
$this->addSql('ALTER TABLE sales_bundle__credit_note CHANGE options options LONGTEXT NOT NULL COLLATE `utf8mb4_bin`');
$this->addSql('ALTER TABLE sales_bundle__credit_note_line CHANGE options options LONGTEXT NOT NULL COLLATE `utf8mb4_bin`');
$this->addSql('ALTER TABLE sales_bundle__delivery_note CHANGE options options LONGTEXT NOT NULL COLLATE `utf8mb4_bin`');
$this->addSql('ALTER TABLE sales_bundle__delivery_note_line CHANGE options options LONGTEXT NOT NULL COLLATE `utf8mb4_bin`');
$this->addSql('ALTER TABLE sales_bundle__invoice CHANGE options options LONGTEXT NOT NULL COLLATE `utf8mb4_bin`');
$this->addSql('ALTER TABLE sales_bundle__invoice_line CHANGE options options LONGTEXT NOT NULL COLLATE `utf8mb4_bin`');
$this->addSql('ALTER TABLE sales_bundle__order CHANGE options options LONGTEXT NOT NULL COLLATE `utf8mb4_bin`');
$this->addSql('ALTER TABLE sales_bundle__order_line CHANGE options options LONGTEXT NOT NULL COLLATE `utf8mb4_bin`');
$this->addSql('ALTER TABLE sales_bundle__quotation DROP FOREIGN KEY FK_A0FC50DF5AA1164F');
$this->addSql('DROP INDEX IDX_A0FC50DF5AA1164F ON sales_bundle__quotation');
$this->addSql('ALTER TABLE sales_bundle__quotation DROP payment_method_id, DROP validity_in_days, CHANGE options options LONGTEXT NOT NULL COLLATE `utf8mb4_bin`');
$this->addSql('ALTER TABLE sales_bundle__quotation_line CHANGE options options LONGTEXT NOT NULL COLLATE `utf8mb4_bin`');
$this->addSql('ALTER TABLE shipments_bundle__carrier DROP is_relay');
$this->addSql('ALTER TABLE shipments_bundle__order_options DROP length, DROP width, DROP height');
$this->addSql('ALTER TABLE stocks_bundle__stock_location DROP quantity_available');
$this->addSql('ALTER TABLE stocks_bundle__stock_product DROP quantity_available');
$this->addSql('ALTER TABLE suppliers_orders_bundle__receipt_note CHANGE options options LONGTEXT NOT NULL COLLATE `utf8mb4_bin`');
$this->addSql('ALTER TABLE suppliers_orders_bundle__receipt_note_line CHANGE options options LONGTEXT NOT NULL COLLATE `utf8mb4_bin`');
$this->addSql('ALTER TABLE suppliers_orders_bundle__supplier_order_line CHANGE options options LONGTEXT NOT NULL COLLATE `utf8mb4_bin`');
}
}