<?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 Version20230301111737 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 orders__orders ADD transport_company_id INT DEFAULT NULL, DROP transport_company');
$this->addSql('ALTER TABLE orders__orders ADD CONSTRAINT FK_ED696816F0D0939C FOREIGN KEY (transport_company_id) REFERENCES transport__companies (id) ON DELETE SET NULL');
$this->addSql('CREATE UNIQUE INDEX UNIQ_ED696816F0D0939C ON orders__orders (transport_company_id)');
}
public function down(Schema $schema): void
{
// this down() migration is auto-generated, please modify it to your needs
$this->addSql('ALTER TABLE orders__orders DROP FOREIGN KEY FK_ED696816F0D0939C');
$this->addSql('DROP INDEX UNIQ_ED696816F0D0939C ON orders__orders');
$this->addSql('ALTER TABLE orders__orders ADD transport_company VARCHAR(255) DEFAULT NULL, DROP transport_company_id');
}
}