<?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 Version20230607095119 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 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 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');
}
}