<?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 Version20230216095311 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 linked_order_id INT DEFAULT NULL');
$this->addSql('ALTER TABLE invoice ADD CONSTRAINT FK_90651744E39F23E7 FOREIGN KEY (linked_order_id) REFERENCES `order` (id)');
$this->addSql('CREATE UNIQUE INDEX UNIQ_90651744E39F23E7 ON invoice (linked_order_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_90651744E39F23E7');
$this->addSql('DROP INDEX UNIQ_90651744E39F23E7 ON invoice');
$this->addSql('ALTER TABLE invoice DROP linked_order_id');
}
}