<?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 Version20250602182508 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 reported_incident (id CHAR(36) NOT NULL COMMENT \'(DC2Type:uuid)\', contract_id CHAR(36) DEFAULT NULL COMMENT \'(DC2Type:uuid)\', category VARCHAR(191) NOT NULL, subcategory VARCHAR(191) NOT NULL, created_at DATETIME NOT NULL, updated_at DATETIME NOT NULL, INDEX IDX_17CB030B2576E0FD (contract_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB');
$this->addSql('CREATE TABLE reported_port (id CHAR(36) NOT NULL COMMENT \'(DC2Type:uuid)\', port_id CHAR(36) DEFAULT NULL COMMENT \'(DC2Type:uuid)\', contract_id CHAR(36) DEFAULT NULL COMMENT \'(DC2Type:uuid)\', created_at DATETIME NOT NULL, updated_at DATETIME NOT NULL, INDEX IDX_DFD119A676E92A9C (port_id), INDEX IDX_DFD119A62576E0FD (contract_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB');
$this->addSql('ALTER TABLE reported_incident ADD CONSTRAINT FK_17CB030B2576E0FD FOREIGN KEY (contract_id) REFERENCES contract (id)');
$this->addSql('ALTER TABLE reported_port ADD CONSTRAINT FK_DFD119A676E92A9C FOREIGN KEY (port_id) REFERENCES port (id)');
$this->addSql('ALTER TABLE reported_port ADD CONSTRAINT FK_DFD119A62576E0FD FOREIGN KEY (contract_id) REFERENCES contract (id)');
$this->addSql('ALTER TABLE contract ADD report_description LONGTEXT DEFAULT NULL, ADD vessel_arrived_within_the_laycan TINYINT(1) DEFAULT NULL, ADD vessel_was_substituted TINYINT(1) DEFAULT NULL, ADD addendum_issued TINYINT(1) DEFAULT NULL, ADD addendum_description LONGTEXT DEFAULT NULL');
}
public function down(Schema $schema): void
{
// this down() migration is auto-generated, please modify it to your needs
$this->addSql('ALTER TABLE reported_incident DROP FOREIGN KEY FK_17CB030B2576E0FD');
$this->addSql('ALTER TABLE reported_port DROP FOREIGN KEY FK_DFD119A676E92A9C');
$this->addSql('ALTER TABLE reported_port DROP FOREIGN KEY FK_DFD119A62576E0FD');
$this->addSql('DROP TABLE reported_incident');
$this->addSql('DROP TABLE reported_port');
$this->addSql('ALTER TABLE contract DROP report_description, DROP vessel_arrived_within_the_laycan, DROP vessel_was_substituted, DROP addendum_issued, DROP addendum_description');
}
}