<?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 Version20220429120009 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 CHANGE user_id user_id INT DEFAULT NULL, CHANGE street street VARCHAR(255) DEFAULT NULL, CHANGE zip_code zip_code VARCHAR(255) DEFAULT NULL, CHANGE phone phone VARCHAR(255) DEFAULT NULL, CHANGE country country VARCHAR(255) DEFAULT NULL');
$this->addSql('ALTER TABLE delivery_address CHANGE user_id user_id INT DEFAULT NULL, CHANGE street street VARCHAR(255) DEFAULT NULL, CHANGE zip_code zip_code VARCHAR(255) DEFAULT NULL, CHANGE phone phone VARCHAR(255) DEFAULT NULL, CHANGE country country VARCHAR(255) DEFAULT NULL');
$this->addSql('ALTER TABLE shop DROP FOREIGN KEY FK_AC6A4CA238248176');
$this->addSql('DROP INDEX IDX_AC6A4CA238248176 ON shop');
$this->addSql('ALTER TABLE shop DROP currency_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 CHANGE user_id user_id INT NOT NULL, CHANGE street street VARCHAR(255) NOT NULL, CHANGE zip_code zip_code INT NOT NULL, CHANGE phone phone VARCHAR(255) NOT NULL, CHANGE country country VARCHAR(255) NOT NULL');
$this->addSql('ALTER TABLE delivery_address CHANGE user_id user_id INT NOT NULL, CHANGE street street VARCHAR(255) NOT NULL, CHANGE zip_code zip_code INT NOT NULL, CHANGE phone phone VARCHAR(255) NOT NULL, CHANGE country country VARCHAR(255) NOT NULL');
$this->addSql('ALTER TABLE shop ADD currency_id INT DEFAULT NULL');
$this->addSql('ALTER TABLE shop ADD CONSTRAINT FK_AC6A4CA238248176 FOREIGN KEY (currency_id) REFERENCES currency (id)');
$this->addSql('CREATE INDEX IDX_AC6A4CA238248176 ON shop (currency_id)');
}
}