<?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 Version20230904085412 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 planning_bundle__slot ADD task_id BINARY(16) DEFAULT NULL COMMENT \'(DC2Type:uuid)\', ADD task_time_id BINARY(16) DEFAULT NULL COMMENT \'(DC2Type:uuid)\'');
$this->addSql('ALTER TABLE planning_bundle__slot ADD CONSTRAINT FK_788927478DB60186 FOREIGN KEY (task_id) REFERENCES projects_bundle__task (id)');
$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_788927478DB60186 ON planning_bundle__slot (task_id)');
$this->addSql('CREATE INDEX IDX_78892747410BF7D1 ON planning_bundle__slot (task_time_id)');
$this->addSql('ALTER TABLE projects_bundle__project_quotation ADD quotation_id BINARY(16) DEFAULT NULL COMMENT \'(DC2Type:uuid)\'');
$this->addSql('ALTER TABLE projects_bundle__project_quotation ADD CONSTRAINT FK_35DF4AB4B4EA4E60 FOREIGN KEY (quotation_id) REFERENCES sales_bundle__quotation (id)');
$this->addSql('CREATE UNIQUE INDEX UNIQ_35DF4AB4B4EA4E60 ON projects_bundle__project_quotation (quotation_id)');
$this->addSql('ALTER TABLE projects_bundle__task ADD opportunity_id BINARY(16) DEFAULT NULL COMMENT \'(DC2Type:uuid)\'');
$this->addSql('ALTER TABLE projects_bundle__task ADD CONSTRAINT FK_FD5802CF9A34590F FOREIGN KEY (opportunity_id) REFERENCES crm_bundle__opportunity (id)');
$this->addSql('CREATE INDEX IDX_FD5802CF9A34590F ON projects_bundle__task (opportunity_id)');
$this->addSql('ALTER TABLE projects_bundle__task_model ADD product_id BINARY(16) DEFAULT NULL COMMENT \'(DC2Type:uuid)\', CHANGE todos todos LONGTEXT NOT NULL COMMENT \'(DC2Type:json)\'');
$this->addSql('ALTER TABLE projects_bundle__task_model ADD CONSTRAINT FK_7476A68A4584665A FOREIGN KEY (product_id) REFERENCES products_bundle__product (id)');
$this->addSql('CREATE INDEX IDX_7476A68A4584665A ON projects_bundle__task_model (product_id)');
}
public function down(Schema $schema): void
{
// this down() migration is auto-generated, please modify it to your needs
$this->addSql('ALTER TABLE planning_bundle__slot DROP FOREIGN KEY FK_788927478DB60186');
$this->addSql('ALTER TABLE planning_bundle__slot DROP FOREIGN KEY FK_78892747410BF7D1');
$this->addSql('DROP INDEX IDX_788927478DB60186 ON planning_bundle__slot');
$this->addSql('DROP INDEX IDX_78892747410BF7D1 ON planning_bundle__slot');
$this->addSql('ALTER TABLE planning_bundle__slot DROP task_id, DROP task_time_id');
$this->addSql('ALTER TABLE projects_bundle__project_quotation DROP FOREIGN KEY FK_35DF4AB4B4EA4E60');
$this->addSql('DROP INDEX UNIQ_35DF4AB4B4EA4E60 ON projects_bundle__project_quotation');
$this->addSql('ALTER TABLE projects_bundle__project_quotation DROP quotation_id');
$this->addSql('ALTER TABLE projects_bundle__task_model DROP FOREIGN KEY FK_7476A68A4584665A');
$this->addSql('DROP INDEX IDX_7476A68A4584665A ON projects_bundle__task_model');
$this->addSql('ALTER TABLE projects_bundle__task_model DROP product_id, CHANGE todos todos LONGTEXT NOT NULL COLLATE `utf8mb4_bin`');
$this->addSql('ALTER TABLE projects_bundle__task DROP FOREIGN KEY FK_FD5802CF9A34590F');
$this->addSql('DROP INDEX IDX_FD5802CF9A34590F ON projects_bundle__task');
$this->addSql('ALTER TABLE projects_bundle__task DROP opportunity_id');
}
}