<?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 Version20250911193811 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 operation_incident (id CHAR(36) NOT NULL COMMENT \'(DC2Type:uuid)\', operation_report_id CHAR(36) DEFAULT NULL COMMENT \'(DC2Type:uuid)\', category VARCHAR(255) NOT NULL, subcategory VARCHAR(255) NOT NULL, created_at DATETIME NOT NULL, updated_at DATETIME NOT NULL, INDEX IDX_D875DE97D83E2D22 (operation_report_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB');
$this->addSql('CREATE TABLE operation_report (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_B9AFCEE676E92A9C (port_id), INDEX IDX_B9AFCEE62576E0FD (contract_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB');
$this->addSql('ALTER TABLE operation_incident ADD CONSTRAINT FK_D875DE97D83E2D22 FOREIGN KEY (operation_report_id) REFERENCES operation_report (id)');
$this->addSql('ALTER TABLE operation_report ADD CONSTRAINT FK_B9AFCEE676E92A9C FOREIGN KEY (port_id) REFERENCES port (id)');
$this->addSql('ALTER TABLE operation_report ADD CONSTRAINT FK_B9AFCEE62576E0FD FOREIGN KEY (contract_id) REFERENCES contract (id)');
$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');
}
public function down(Schema $schema): void
{
// this down() migration is auto-generated, please modify it to your needs
$this->addSql('CREATE TABLE reported_incident (id CHAR(36) CHARACTER SET utf8mb4 NOT NULL COLLATE `utf8mb4_unicode_ci` COMMENT \'(DC2Type:uuid)\', reported_port_id CHAR(36) CHARACTER SET utf8mb4 DEFAULT NULL COLLATE `utf8mb4_unicode_ci` COMMENT \'(DC2Type:uuid)\', category VARCHAR(191) CHARACTER SET utf8mb4 NOT NULL COLLATE `utf8mb4_unicode_ci`, subcategory VARCHAR(191) CHARACTER SET utf8mb4 NOT NULL COLLATE `utf8mb4_unicode_ci`, created_at DATETIME NOT NULL, updated_at DATETIME NOT NULL, INDEX IDX_17CB030BD160AF67 (reported_port_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB COMMENT = \'\' ');
$this->addSql('CREATE TABLE reported_port (id CHAR(36) CHARACTER SET utf8mb4 NOT NULL COLLATE `utf8mb4_unicode_ci` COMMENT \'(DC2Type:uuid)\', port_id CHAR(36) CHARACTER SET utf8mb4 DEFAULT NULL COLLATE `utf8mb4_unicode_ci` COMMENT \'(DC2Type:uuid)\', contract_id CHAR(36) CHARACTER SET utf8mb4 DEFAULT NULL COLLATE `utf8mb4_unicode_ci` 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 COMMENT = \'\' ');
$this->addSql('ALTER TABLE reported_port ADD CONSTRAINT FK_DFD119A676E92A9C FOREIGN KEY (port_id) REFERENCES port (id) ON UPDATE NO ACTION ON DELETE NO ACTION');
$this->addSql('ALTER TABLE reported_port ADD CONSTRAINT FK_DFD119A62576E0FD FOREIGN KEY (contract_id) REFERENCES contract (id) ON UPDATE NO ACTION ON DELETE NO ACTION');
$this->addSql('ALTER TABLE operation_incident DROP FOREIGN KEY FK_D875DE97D83E2D22');
$this->addSql('ALTER TABLE operation_report DROP FOREIGN KEY FK_B9AFCEE676E92A9C');
$this->addSql('ALTER TABLE operation_report DROP FOREIGN KEY FK_B9AFCEE62576E0FD');
$this->addSql('DROP TABLE operation_incident');
$this->addSql('DROP TABLE operation_report');
$this->addSql('ALTER TABLE additional_cost CHANGE additional_cost additional_cost VARCHAR(191) DEFAULT NULL, CHANGE additional_cost_currency additional_cost_currency VARCHAR(191) DEFAULT NULL, CHANGE additional_type additional_type VARCHAR(191) DEFAULT NULL, CHANGE description description VARCHAR(191) DEFAULT NULL');
$this->addSql('ALTER TABLE berth CHANGE restriction_info_source restriction_info_source VARCHAR(191) DEFAULT NULL');
$this->addSql('ALTER TABLE cargo CHANGE subtype subtype VARCHAR(191) DEFAULT NULL');
$this->addSql('ALTER TABLE checklist CHANGE checklist_name checklist_name VARCHAR(191) NOT NULL');
$this->addSql('ALTER TABLE contract CHANGE contract_type contract_type VARCHAR(191) DEFAULT NULL, CHANGE freight_cost freight_cost VARCHAR(191) DEFAULT NULL, CHANGE freight_cost_currency freight_cost_currency VARCHAR(191) DEFAULT NULL, CHANGE freight_type freight_type VARCHAR(191) DEFAULT NULL, CHANGE demurrage_per_day demurrage_per_day VARCHAR(191) DEFAULT NULL, CHANGE demurrage_per_day_currency demurrage_per_day_currency VARCHAR(191) DEFAULT NULL, CHANGE address_commission address_commission VARCHAR(191) DEFAULT NULL, CHANGE brokerage_commission brokerage_commission VARCHAR(191) DEFAULT NULL, CHANGE demurrage_status demurrage_status VARCHAR(191) DEFAULT NULL, CHANGE final_demurrage_cost final_demurrage_cost VARCHAR(191) DEFAULT NULL, CHANGE final_demurrage_cost_currency final_demurrage_cost_currency VARCHAR(191) DEFAULT NULL, CHANGE demurrage_paid_by_charterer demurrage_paid_by_charterer VARCHAR(191) DEFAULT NULL, CHANGE demurrage_paid_by_charterer_currency demurrage_paid_by_charterer_currency VARCHAR(191) DEFAULT NULL, CHANGE hire_per_day hire_per_day VARCHAR(191) DEFAULT NULL, CHANGE hire_per_day_currency hire_per_day_currency VARCHAR(191) DEFAULT NULL');
$this->addSql('ALTER TABLE contract_cargo CHANGE quantity_m3 quantity_m3 VARCHAR(191) DEFAULT NULL, CHANGE quantity_mt quantity_mt VARCHAR(191) DEFAULT NULL');
$this->addSql('ALTER TABLE delivery_notice CHANGE notice_type notice_type VARCHAR(191) NOT NULL, CHANGE status status VARCHAR(191) NOT NULL');
$this->addSql('ALTER TABLE hire CHANGE fuel_type fuel_type VARCHAR(191) DEFAULT NULL, CHANGE fuel_type2 fuel_type2 VARCHAR(191) DEFAULT NULL, CHANGE fuel_type3 fuel_type3 VARCHAR(191) DEFAULT NULL, CHANGE price price VARCHAR(191) DEFAULT NULL, CHANGE price2 price2 VARCHAR(191) DEFAULT NULL, CHANGE price3 price3 VARCHAR(191) DEFAULT NULL, CHANGE price_currency price_currency VARCHAR(191) DEFAULT NULL, CHANGE price_currency2 price_currency2 VARCHAR(191) DEFAULT NULL, CHANGE price_currency3 price_currency3 VARCHAR(191) DEFAULT NULL, CHANGE off_hire_cost off_hire_cost VARCHAR(191) DEFAULT NULL, CHANGE off_hire_cost_currency off_hire_cost_currency VARCHAR(191) DEFAULT NULL, CHANGE address_commission address_commission VARCHAR(191) DEFAULT NULL, CHANGE extra_costs extra_costs VARCHAR(191) DEFAULT NULL, CHANGE extra_costs_currency extra_costs_currency VARCHAR(191) DEFAULT NULL, CHANGE extra_costs_description extra_costs_description VARCHAR(191) DEFAULT NULL, CHANGE total_invoice total_invoice VARCHAR(191) DEFAULT NULL, CHANGE total_invoice_currency total_invoice_currency VARCHAR(191) DEFAULT NULL, CHANGE invoice_status invoice_status VARCHAR(191) DEFAULT NULL');
$this->addSql('ALTER TABLE payment CHANGE amount amount VARCHAR(191) DEFAULT NULL, CHANGE amount_currency amount_currency VARCHAR(191) DEFAULT NULL, CHANGE description description VARCHAR(191) DEFAULT NULL');
$this->addSql('ALTER TABLE port CHANGE geographic_location geographic_location VARCHAR(191) DEFAULT NULL, CHANGE cost_information_source cost_information_source VARCHAR(191) DEFAULT NULL, CHANGE state state VARCHAR(191) DEFAULT NULL, CHANGE country country VARCHAR(191) NOT NULL');
$this->addSql('ALTER TABLE report CHANGE report_type report_type VARCHAR(191) NOT NULL');
$this->addSql('ALTER TABLE vessel CHANGE dwt dwt VARCHAR(191) NOT NULL');
}
}