<?php
declare(strict_types=1);
namespace SuppliersOrdersBundleMigrations;
use Doctrine\DBAL\Schema\Schema;
use Doctrine\Migrations\AbstractMigration;
final class Version20230216133354 extends AbstractMigration
{
public function up(Schema $schema): void
{
$this->addSql('ALTER TABLE suppliers_orders_bundle__supplier_order ADD delivery_country_id BINARY(16) DEFAULT NULL COMMENT \'(DC2Type:uuid)\', ADD delivery_country_state_id BINARY(16) DEFAULT NULL COMMENT \'(DC2Type:uuid)\', ADD delivery_city VARCHAR(128) DEFAULT NULL, ADD delivery_postcode VARCHAR(32) DEFAULT NULL, ADD delivery_address VARCHAR(255) DEFAULT NULL, ADD delivery_address2 VARCHAR(255) DEFAULT NULL');
$this->addSql('ALTER TABLE suppliers_orders_bundle__supplier_order ADD CONSTRAINT FK_E63ACA81E76AA954 FOREIGN KEY (delivery_country_id) REFERENCES country (id)');
$this->addSql('ALTER TABLE suppliers_orders_bundle__supplier_order ADD CONSTRAINT FK_E63ACA81737BF729 FOREIGN KEY (delivery_country_state_id) REFERENCES country_state (id)');
$this->addSql('CREATE INDEX IDX_E63ACA81E76AA954 ON suppliers_orders_bundle__supplier_order (delivery_country_id)');
$this->addSql('CREATE INDEX IDX_E63ACA81737BF729 ON suppliers_orders_bundle__supplier_order (delivery_country_state_id)');
}
public function down(Schema $schema): void
{
$this->addSql('ALTER TABLE suppliers_orders_bundle__supplier_order DROP FOREIGN KEY FK_E63ACA81E76AA954');
$this->addSql('ALTER TABLE suppliers_orders_bundle__supplier_order DROP FOREIGN KEY FK_E63ACA81737BF729');
$this->addSql('DROP INDEX IDX_E63ACA81E76AA954 ON suppliers_orders_bundle__supplier_order');
$this->addSql('DROP INDEX IDX_E63ACA81737BF729 ON suppliers_orders_bundle__supplier_order');
$this->addSql('ALTER TABLE suppliers_orders_bundle__supplier_order DROP delivery_country_id, DROP delivery_country_state_id, DROP delivery_city, DROP delivery_postcode, DROP delivery_address, DROP delivery_address2');
}
}