<?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 Version20230301102913 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 carts__carts ADD transport_company_id INT DEFAULT NULL, DROP transport_company');
$this->addSql('ALTER TABLE carts__carts ADD CONSTRAINT FK_6808FEADF0D0939C FOREIGN KEY (transport_company_id) REFERENCES transport__companies (id) ON DELETE SET NULL');
$this->addSql('CREATE UNIQUE INDEX UNIQ_6808FEADF0D0939C ON carts__carts (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 carts__carts DROP FOREIGN KEY FK_6808FEADF0D0939C');
$this->addSql('DROP INDEX UNIQ_6808FEADF0D0939C ON carts__carts');
$this->addSql('ALTER TABLE carts__carts ADD transport_company VARCHAR(255) DEFAULT NULL, DROP transport_company_id');
}
}