migrations/Version20251017123925.php line 1

Open in your IDE?
  1. <?php
  2. declare(strict_types=1);
  3. namespace DoctrineMigrations;
  4. use Doctrine\DBAL\Schema\Schema;
  5. use Doctrine\Migrations\AbstractMigration;
  6. /**
  7.  * Auto-generated Migration: Please modify to your needs!
  8.  */
  9. final class Version20251017123925 extends AbstractMigration
  10. {
  11.     public function getDescription(): string
  12.     {
  13.         return '';
  14.     }
  15.     public function up(Schema $schema): void
  16.     {
  17.         // this up() migration is auto-generated, please modify it to your needs
  18.         $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');
  19.         $this->addSql('ALTER TABLE redelivery_notice ADD CONSTRAINT FK_BBB040332576E0FD FOREIGN KEY (contract_id) REFERENCES contract (id)');
  20.         $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');
  21.         $this->addSql('ALTER TABLE contract ADD CONSTRAINT FK_E98F2859526ECC18 FOREIGN KEY (redelivery_port1_id) REFERENCES port (id)');
  22.         $this->addSql('ALTER TABLE contract ADD CONSTRAINT FK_E98F285940DB63F6 FOREIGN KEY (redelivery_port2_id) REFERENCES port (id)');
  23.         $this->addSql('CREATE INDEX IDX_E98F2859526ECC18 ON contract (redelivery_port1_id)');
  24.         $this->addSql('CREATE INDEX IDX_E98F285940DB63F6 ON contract (redelivery_port2_id)');
  25.     }
  26.     public function down(Schema $schema): void
  27.     {
  28.         // this down() migration is auto-generated, please modify it to your needs
  29.         $this->addSql('ALTER TABLE redelivery_notice DROP FOREIGN KEY FK_BBB040332576E0FD');
  30.         $this->addSql('DROP TABLE redelivery_notice');
  31.         $this->addSql('ALTER TABLE contract DROP FOREIGN KEY FK_E98F2859526ECC18');
  32.         $this->addSql('ALTER TABLE contract DROP FOREIGN KEY FK_E98F285940DB63F6');
  33.         $this->addSql('DROP INDEX IDX_E98F2859526ECC18 ON contract');
  34.         $this->addSql('DROP INDEX IDX_E98F285940DB63F6 ON contract');
  35.         $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');
  36.     }
  37. }