<?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 Version20231218104145 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 menu (id BINARY(16) NOT NULL COMMENT \'(DC2Type:uuid)\', created_by_id BINARY(16) DEFAULT NULL COMMENT \'(DC2Type:uuid)\', updated_by_id BINARY(16) DEFAULT NULL COMMENT \'(DC2Type:uuid)\', name VARCHAR(255) NOT NULL, position INT DEFAULT NULL, created_at DATETIME NOT NULL, updated_at DATETIME NOT NULL, INDEX IDX_7D053A93B03A8386 (created_by_id), INDEX IDX_7D053A93896DBBDE (updated_by_id), INDEX name (name), INDEX position (position), INDEX created_at (created_at), INDEX updated_at (updated_at), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB');
$this->addSql('CREATE TABLE tax_rule_translations (id INT AUTO_INCREMENT NOT NULL, object_id BINARY(16) DEFAULT NULL COMMENT \'(DC2Type:uuid)\', locale VARCHAR(8) NOT NULL, field VARCHAR(32) NOT NULL, content LONGTEXT DEFAULT NULL, INDEX IDX_ABF78759232D562B (object_id), FULLTEXT INDEX content (content), UNIQUE INDEX lookup_unique_idx (locale, object_id, field), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB');
$this->addSql('CREATE TABLE tax_translations (id INT AUTO_INCREMENT NOT NULL, object_id BINARY(16) DEFAULT NULL COMMENT \'(DC2Type:uuid)\', locale VARCHAR(8) NOT NULL, field VARCHAR(32) NOT NULL, content LONGTEXT DEFAULT NULL, INDEX IDX_5687791F232D562B (object_id), FULLTEXT INDEX content (content), UNIQUE INDEX lookup_unique_idx (locale, object_id, field), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB');
$this->addSql('ALTER TABLE menu ADD CONSTRAINT FK_7D053A93B03A8386 FOREIGN KEY (created_by_id) REFERENCES user (id)');
$this->addSql('ALTER TABLE menu ADD CONSTRAINT FK_7D053A93896DBBDE FOREIGN KEY (updated_by_id) REFERENCES user (id)');
$this->addSql('ALTER TABLE tax_rule_translations ADD CONSTRAINT FK_ABF78759232D562B FOREIGN KEY (object_id) REFERENCES tax_rule (id) ON DELETE CASCADE');
$this->addSql('ALTER TABLE tax_translations ADD CONSTRAINT FK_5687791F232D562B FOREIGN KEY (object_id) REFERENCES tax (id) ON DELETE CASCADE');
$this->addSql('ALTER TABLE crm_bundle__opportunity CHANGE options options LONGTEXT DEFAULT NULL COMMENT \'(DC2Type:json)\'');
$this->addSql('ALTER TABLE planning_bundle__slot DROP FOREIGN KEY FK_78892747410BF7D1');
$this->addSql('DROP INDEX IDX_78892747410BF7D1 ON planning_bundle__slot');
$this->addSql('ALTER TABLE planning_bundle__slot DROP task_time_id');
$this->addSql('ALTER TABLE products_bundle__declination CHANGE options options LONGTEXT NOT NULL COMMENT \'(DC2Type:json)\'');
$this->addSql('ALTER TABLE projects_bundle__task_time ADD slot_id BINARY(16) DEFAULT NULL COMMENT \'(DC2Type:uuid)\'');
$this->addSql('ALTER TABLE projects_bundle__task_time ADD CONSTRAINT FK_3040BF2759E5119C FOREIGN KEY (slot_id) REFERENCES planning_bundle__slot (id)');
$this->addSql('CREATE INDEX IDX_3040BF2759E5119C ON projects_bundle__task_time (slot_id)');
$this->addSql('ALTER TABLE shipments_bundle__picking_history ADD stock_location_id BINARY(16) DEFAULT NULL COMMENT \'(DC2Type:uuid)\'');
$this->addSql('ALTER TABLE shipments_bundle__picking_history ADD CONSTRAINT FK_F9B6EAE7D98387BA FOREIGN KEY (stock_location_id) REFERENCES stocks_bundle__stock_location (id)');
$this->addSql('CREATE INDEX IDX_F9B6EAE7D98387BA ON shipments_bundle__picking_history (stock_location_id)');
$this->addSql('ALTER TABLE tax ADD manufactured_pack_sales_account_number VARCHAR(32) DEFAULT NULL');
$this->addSql('CREATE INDEX manufactured_pack_sales_account_number ON tax (manufactured_pack_sales_account_number)');
$this->addSql('ALTER TABLE team ADD position INT DEFAULT NULL');
$this->addSql('CREATE INDEX position ON team (position)');
}
public function down(Schema $schema): void
{
// this down() migration is auto-generated, please modify it to your needs
$this->addSql('ALTER TABLE menu DROP FOREIGN KEY FK_7D053A93B03A8386');
$this->addSql('ALTER TABLE menu DROP FOREIGN KEY FK_7D053A93896DBBDE');
$this->addSql('ALTER TABLE tax_rule_translations DROP FOREIGN KEY FK_ABF78759232D562B');
$this->addSql('ALTER TABLE tax_translations DROP FOREIGN KEY FK_5687791F232D562B');
$this->addSql('DROP TABLE menu');
$this->addSql('DROP TABLE tax_rule_translations');
$this->addSql('DROP TABLE tax_translations');
$this->addSql('ALTER TABLE planning_bundle__slot ADD task_time_id BINARY(16) DEFAULT NULL COMMENT \'(DC2Type:uuid)\'');
$this->addSql('ALTER TABLE planning_bundle__slot ADD CONSTRAINT FK_78892747410BF7D1 FOREIGN KEY (task_time_id) REFERENCES projects_bundle__task_time (id)');
$this->addSql('CREATE INDEX IDX_78892747410BF7D1 ON planning_bundle__slot (task_time_id)');
$this->addSql('DROP INDEX position ON team');
$this->addSql('ALTER TABLE team DROP position');
$this->addSql('ALTER TABLE projects_bundle__task_time DROP FOREIGN KEY FK_3040BF2759E5119C');
$this->addSql('DROP INDEX IDX_3040BF2759E5119C ON projects_bundle__task_time');
$this->addSql('ALTER TABLE projects_bundle__task_time DROP slot_id');
$this->addSql('ALTER TABLE products_bundle__declination CHANGE options options LONGTEXT NOT NULL COLLATE `utf8mb4_bin`');
$this->addSql('ALTER TABLE crm_bundle__opportunity CHANGE options options LONGTEXT DEFAULT NULL COLLATE `utf8mb4_bin`');
$this->addSql('ALTER TABLE shipments_bundle__picking_history DROP FOREIGN KEY FK_F9B6EAE7D98387BA');
$this->addSql('DROP INDEX IDX_F9B6EAE7D98387BA ON shipments_bundle__picking_history');
$this->addSql('ALTER TABLE shipments_bundle__picking_history DROP stock_location_id');
$this->addSql('DROP INDEX manufactured_pack_sales_account_number ON tax');
$this->addSql('ALTER TABLE tax DROP manufactured_pack_sales_account_number');
}
}