<?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 Version20251017123925 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('CREATE TABLE redelivery_notice (id CHAR(36) NOT NULL COMMENT \'(DC2Type:uuid)\', contract_id CHAR(36) DEFAULT NULL COMMENT \'(DC2Type:uuid)\', notice_number INT DEFAULT NULL, notice_type VARCHAR(191) NOT NULL, notice_date DATE DEFAULT NULL, sent_to_charterer TINYINT(1) DEFAULT NULL, status VARCHAR(191) NOT NULL, created_at DATETIME NOT NULL, updated_at DATETIME NOT NULL, INDEX IDX_BBB040332576E0FD (contract_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB');
$this->addSql('ALTER TABLE redelivery_notice ADD CONSTRAINT FK_BBB040332576E0FD FOREIGN KEY (contract_id) REFERENCES contract (id)');
$this->addSql('ALTER TABLE contract ADD redelivery_port1_id CHAR(36) DEFAULT NULL COMMENT \'(DC2Type:uuid)\', ADD redelivery_port2_id CHAR(36) DEFAULT NULL COMMENT \'(DC2Type:uuid)\', ADD redelivery_eta_arrival DATETIME DEFAULT NULL, ADD redelivered_arrival DATETIME DEFAULT NULL, ADD redelivery_aprox_notice1 INT DEFAULT NULL, ADD redelivery_aprox_notice2 INT DEFAULT NULL, ADD redelivery_aprox_notice3 INT DEFAULT NULL, ADD redelivery_aprox_notice4 INT DEFAULT NULL, ADD redelivery_aprox_notice5 INT DEFAULT NULL, ADD redelivery_aprox_notice6 INT DEFAULT NULL, ADD redelivery_aprox_notice7 INT DEFAULT NULL, ADD redelivery_firm_notice1 INT DEFAULT NULL, ADD redelivery_firm_notice2 INT DEFAULT NULL, ADD redelivery_firm_notice3 INT DEFAULT NULL, ADD redelivery_firm_notice4 INT DEFAULT NULL, ADD redelivery_firm_notice5 INT DEFAULT NULL, ADD redelivery_firm_notice6 INT DEFAULT NULL, ADD redelivery_firm_notice7 INT DEFAULT NULL, ADD redelivery_notices_not_aplicable TINYINT(1) DEFAULT NULL, ADD ship_redelivered TINYINT(1) DEFAULT NULL');
$this->addSql('ALTER TABLE contract ADD CONSTRAINT FK_E98F2859526ECC18 FOREIGN KEY (redelivery_port1_id) REFERENCES port (id)');
$this->addSql('ALTER TABLE contract ADD CONSTRAINT FK_E98F285940DB63F6 FOREIGN KEY (redelivery_port2_id) REFERENCES port (id)');
$this->addSql('CREATE INDEX IDX_E98F2859526ECC18 ON contract (redelivery_port1_id)');
$this->addSql('CREATE INDEX IDX_E98F285940DB63F6 ON contract (redelivery_port2_id)');
}
public function down(Schema $schema): void
{
// this down() migration is auto-generated, please modify it to your needs
$this->addSql('ALTER TABLE redelivery_notice DROP FOREIGN KEY FK_BBB040332576E0FD');
$this->addSql('DROP TABLE redelivery_notice');
$this->addSql('ALTER TABLE contract DROP FOREIGN KEY FK_E98F2859526ECC18');
$this->addSql('ALTER TABLE contract DROP FOREIGN KEY FK_E98F285940DB63F6');
$this->addSql('DROP INDEX IDX_E98F2859526ECC18 ON contract');
$this->addSql('DROP INDEX IDX_E98F285940DB63F6 ON contract');
$this->addSql('ALTER TABLE contract DROP redelivery_port1_id, DROP redelivery_port2_id, DROP redelivery_eta_arrival, DROP redelivered_arrival, DROP redelivery_aprox_notice1, DROP redelivery_aprox_notice2, DROP redelivery_aprox_notice3, DROP redelivery_aprox_notice4, DROP redelivery_aprox_notice5, DROP redelivery_aprox_notice6, DROP redelivery_aprox_notice7, DROP redelivery_firm_notice1, DROP redelivery_firm_notice2, DROP redelivery_firm_notice3, DROP redelivery_firm_notice4, DROP redelivery_firm_notice5, DROP redelivery_firm_notice6, DROP redelivery_firm_notice7, DROP redelivery_notices_not_aplicable, DROP ship_redelivered, CHANGE contract_type contract_type VARCHAR(191) DEFAULT NULL');
}
}