<?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 Version20220630091013 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 inventories_bundle__inventory ADD location_id BINARY(16) DEFAULT NULL COMMENT \'(DC2Type:uuid)\', ADD sub_location_id BINARY(16) DEFAULT NULL COMMENT \'(DC2Type:uuid)\'');
$this->addSql('ALTER TABLE inventories_bundle__inventory ADD CONSTRAINT FK_F5586DDC64D218E FOREIGN KEY (location_id) REFERENCES stocks_bundle__location (id)');
$this->addSql('ALTER TABLE inventories_bundle__inventory ADD CONSTRAINT FK_F5586DDCE3B45410 FOREIGN KEY (sub_location_id) REFERENCES stocks_bundle__sub_location (id)');
$this->addSql('CREATE INDEX IDX_F5586DDC64D218E ON inventories_bundle__inventory (location_id)');
$this->addSql('CREATE INDEX IDX_F5586DDCE3B45410 ON inventories_bundle__inventory (sub_location_id)');
$this->addSql('ALTER TABLE stocks_bundle__stock_movement ADD delivery_note_line_id BINARY(16) DEFAULT NULL COMMENT \'(DC2Type:uuid)\'');
$this->addSql('ALTER TABLE stocks_bundle__stock_movement ADD CONSTRAINT FK_11E6623A535E48DC FOREIGN KEY (delivery_note_line_id) REFERENCES sales_bundle__delivery_note_line (id)');
$this->addSql('CREATE INDEX IDX_11E6623A535E48DC ON stocks_bundle__stock_movement (delivery_note_line_id)');
}
public function down(Schema $schema): void
{
// this down() migration is auto-generated, please modify it to your needs
$this->addSql('ALTER TABLE inventories_bundle__inventory DROP FOREIGN KEY FK_F5586DDC64D218E');
$this->addSql('ALTER TABLE inventories_bundle__inventory DROP FOREIGN KEY FK_F5586DDCE3B45410');
$this->addSql('DROP INDEX IDX_F5586DDC64D218E ON inventories_bundle__inventory');
$this->addSql('DROP INDEX IDX_F5586DDCE3B45410 ON inventories_bundle__inventory');
$this->addSql('ALTER TABLE inventories_bundle__inventory DROP location_id, DROP sub_location_id');
$this->addSql('ALTER TABLE stocks_bundle__stock_movement DROP FOREIGN KEY FK_11E6623A535E48DC');
$this->addSql('DROP INDEX IDX_11E6623A535E48DC ON stocks_bundle__stock_movement');
$this->addSql('ALTER TABLE stocks_bundle__stock_movement DROP delivery_note_line_id');
}
}