<?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 Version20230404100255 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 invoice ADD sender_address_id INT DEFAULT NULL, ADD delivery_address_id INT DEFAULT NULL, CHANGE prepayment_sum prepayment_sum NUMERIC(10, 2) DEFAULT \'0\' NOT NULL');
$this->addSql('ALTER TABLE invoice ADD CONSTRAINT FK_9065174471A12A28 FOREIGN KEY (sender_address_id) REFERENCES address (id)');
$this->addSql('ALTER TABLE invoice ADD CONSTRAINT FK_90651744EBF23851 FOREIGN KEY (delivery_address_id) REFERENCES address (id)');
$this->addSql('CREATE UNIQUE INDEX UNIQ_9065174471A12A28 ON invoice (sender_address_id)');
$this->addSql('CREATE UNIQUE INDEX UNIQ_90651744EBF23851 ON invoice (delivery_address_id)');
}
public function down(Schema $schema): void
{
// this down() migration is auto-generated, please modify it to your needs
$this->addSql('ALTER TABLE invoice DROP FOREIGN KEY FK_9065174471A12A28');
$this->addSql('ALTER TABLE invoice DROP FOREIGN KEY FK_90651744EBF23851');
$this->addSql('DROP INDEX UNIQ_9065174471A12A28 ON invoice');
$this->addSql('DROP INDEX UNIQ_90651744EBF23851 ON invoice');
$this->addSql('ALTER TABLE invoice DROP sender_address_id, DROP delivery_address_id, CHANGE prepayment_sum prepayment_sum NUMERIC(10, 2) DEFAULT \'0.00\' NOT NULL');
}
}