<?php
declare(strict_types=1);
namespace StocksBundleMigrations;
use Doctrine\DBAL\Schema\Schema;
use Doctrine\Migrations\AbstractMigration;
final class Version20240624112039 extends AbstractMigration
{
public function up(Schema $schema): void
{
$this->addSql('ALTER TABLE stocks_bundle__warehouse ADD default_location_id BINARY(16) DEFAULT NULL COMMENT \'(DC2Type:uuid)\', ADD default_sub_location_id BINARY(16) DEFAULT NULL COMMENT \'(DC2Type:uuid)\'');
$this->addSql('ALTER TABLE stocks_bundle__warehouse ADD CONSTRAINT FK_CDFD4A43D2BE3238 FOREIGN KEY (default_location_id) REFERENCES stocks_bundle__location (id)');
$this->addSql('ALTER TABLE stocks_bundle__warehouse ADD CONSTRAINT FK_CDFD4A437BE2FCCC FOREIGN KEY (default_sub_location_id) REFERENCES stocks_bundle__sub_location (id)');
$this->addSql('CREATE INDEX IDX_CDFD4A43D2BE3238 ON stocks_bundle__warehouse (default_location_id)');
$this->addSql('CREATE INDEX IDX_CDFD4A437BE2FCCC ON stocks_bundle__warehouse (default_sub_location_id)');
}
public function down(Schema $schema): void
{
$this->addSql('ALTER TABLE stocks_bundle__warehouse DROP FOREIGN KEY FK_CDFD4A43D2BE3238');
$this->addSql('ALTER TABLE stocks_bundle__warehouse DROP FOREIGN KEY FK_CDFD4A437BE2FCCC');
$this->addSql('DROP INDEX IDX_CDFD4A43D2BE3238 ON stocks_bundle__warehouse');
$this->addSql('DROP INDEX IDX_CDFD4A437BE2FCCC ON stocks_bundle__warehouse');
$this->addSql('ALTER TABLE stocks_bundle__warehouse DROP default_location_id, DROP default_sub_location_id');
}
}