<?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 Version20250207160648 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 charterer DROP FOREIGN KEY FK_1A9C8BA8D905C92C');
$this->addSql('DROP INDEX UNIQ_1A9C8BA8D905C92C ON charterer');
$this->addSql('ALTER TABLE charterer DROP primary_contact_id');
$this->addSql('ALTER TABLE contact DROP FOREIGN KEY FK_4C62E63890E4571D');
$this->addSql('DROP INDEX IDX_4C62E63890E4571D ON contact');
$this->addSql('ALTER TABLE contact DROP charterer_id');
}
public function down(Schema $schema): void
{
// this down() migration is auto-generated, please modify it to your needs
$this->addSql('ALTER TABLE charterer ADD primary_contact_id CHAR(36) DEFAULT NULL COMMENT \'(DC2Type:uuid)\'');
$this->addSql('ALTER TABLE charterer ADD CONSTRAINT FK_1A9C8BA8D905C92C FOREIGN KEY (primary_contact_id) REFERENCES contact (id) ON UPDATE NO ACTION ON DELETE NO ACTION');
$this->addSql('CREATE UNIQUE INDEX UNIQ_1A9C8BA8D905C92C ON charterer (primary_contact_id)');
$this->addSql('ALTER TABLE contact ADD charterer_id CHAR(36) DEFAULT NULL COMMENT \'(DC2Type:uuid)\'');
$this->addSql('ALTER TABLE contact ADD CONSTRAINT FK_4C62E63890E4571D FOREIGN KEY (charterer_id) REFERENCES charterer (id) ON UPDATE NO ACTION ON DELETE NO ACTION');
$this->addSql('CREATE INDEX IDX_4C62E63890E4571D ON contact (charterer_id)');
}
}