<?php
declare(strict_types=1);
namespace DoctrineMigrations;
use Doctrine\DBAL\Schema\Schema;
use Doctrine\Migrations\AbstractMigration;
/**
* Auto-generated Migration: Please modify to your needs!
*/
final class Version20220808075025 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 billing_address DROP FOREIGN KEY FK_6660E456A76ED395');
$this->addSql('DROP INDEX IDX_6660E456A76ED395 ON billing_address');
$this->addSql('ALTER TABLE billing_address CHANGE user_id customer_id INT DEFAULT NULL');
$this->addSql('ALTER TABLE billing_address ADD CONSTRAINT FK_6660E4569395C3F3 FOREIGN KEY (customer_id) REFERENCES user (id)');
$this->addSql('CREATE INDEX IDX_6660E4569395C3F3 ON billing_address (customer_id)');
$this->addSql('ALTER TABLE delivery_address DROP FOREIGN KEY FK_750D05FA76ED395');
$this->addSql('DROP INDEX IDX_750D05FA76ED395 ON delivery_address');
$this->addSql('ALTER TABLE delivery_address CHANGE user_id customer_id INT DEFAULT NULL');
$this->addSql('ALTER TABLE delivery_address ADD CONSTRAINT FK_750D05F9395C3F3 FOREIGN KEY (customer_id) REFERENCES user (id)');
$this->addSql('CREATE INDEX IDX_750D05F9395C3F3 ON delivery_address (customer_id)');
}
public function down(Schema $schema): void
{
// this down() migration is auto-generated, please modify it to your needs
$this->addSql('ALTER TABLE billing_address DROP FOREIGN KEY FK_6660E4569395C3F3');
$this->addSql('DROP INDEX IDX_6660E4569395C3F3 ON billing_address');
$this->addSql('ALTER TABLE billing_address CHANGE customer_id user_id INT DEFAULT NULL');
$this->addSql('ALTER TABLE billing_address ADD CONSTRAINT FK_6660E456A76ED395 FOREIGN KEY (user_id) REFERENCES user (id)');
$this->addSql('CREATE INDEX IDX_6660E456A76ED395 ON billing_address (user_id)');
$this->addSql('ALTER TABLE delivery_address DROP FOREIGN KEY FK_750D05F9395C3F3');
$this->addSql('DROP INDEX IDX_750D05F9395C3F3 ON delivery_address');
$this->addSql('ALTER TABLE delivery_address CHANGE customer_id user_id INT DEFAULT NULL');
$this->addSql('ALTER TABLE delivery_address ADD CONSTRAINT FK_750D05FA76ED395 FOREIGN KEY (user_id) REFERENCES user (id)');
$this->addSql('CREATE INDEX IDX_750D05FA76ED395 ON delivery_address (user_id)');
}
}