<?php
declare(strict_types=1);
namespace SalesBundleMigrations;
use Doctrine\DBAL\Schema\Schema;
use Doctrine\Migrations\AbstractMigration;
/**
* Auto-generated Migration: Please modify to your needs!
*/
final class Version20230908081654 extends AbstractMigration
{
public function up(Schema $schema): void
{
// this up() migration is auto-generated, please modify it to your needs
$this->addSql('ALTER TABLE sales_bundle__customer_options ADD default_payment_method_id BINARY(16) DEFAULT NULL COMMENT \'(DC2Type:uuid)\', ADD default_payment_term_id BINARY(16) DEFAULT NULL COMMENT \'(DC2Type:uuid)\'');
$this->addSql('ALTER TABLE sales_bundle__customer_options ADD CONSTRAINT FK_5E01AC22AF212FD0 FOREIGN KEY (default_payment_method_id) REFERENCES sales_bundle__payment_method (id)');
$this->addSql('ALTER TABLE sales_bundle__customer_options ADD CONSTRAINT FK_5E01AC228F3393CA FOREIGN KEY (default_payment_term_id) REFERENCES sales_bundle__payment_term (id)');
$this->addSql('CREATE INDEX IDX_5E01AC22AF212FD0 ON sales_bundle__customer_options (default_payment_method_id)');
$this->addSql('CREATE INDEX IDX_5E01AC228F3393CA ON sales_bundle__customer_options (default_payment_term_id)');
}
public function down(Schema $schema): void
{
// this down() migration is auto-generated, please modify it to your needs
$this->addSql('ALTER TABLE sales_bundle__customer_options DROP FOREIGN KEY FK_5E01AC22AF212FD0');
$this->addSql('ALTER TABLE sales_bundle__customer_options DROP FOREIGN KEY FK_5E01AC228F3393CA');
$this->addSql('DROP INDEX IDX_5E01AC22AF212FD0 ON sales_bundle__customer_options');
$this->addSql('DROP INDEX IDX_5E01AC228F3393CA ON sales_bundle__customer_options');
$this->addSql('ALTER TABLE sales_bundle__customer_options DROP default_payment_method_id, DROP default_payment_term_id');
}
}