<?php
declare(strict_types=1);
namespace Application\Migrations;
use Doctrine\DBAL\Schema\Schema;
use Doctrine\Migrations\AbstractMigration;
/**
* Auto-generated Migration: Please modify to your needs!
*/
final class Version20200904094120 extends AbstractMigration
{
public function up(Schema $schema): void
{
// this up() migration is auto-generated, please modify it to your needs
$this->abortIf('mysql' !== $this->connection->getDatabasePlatform()->getName(), 'Migration can only be executed safely on \'mysql\'.');
$this->addSql('CREATE TABLE legal_entity_transfer (id INT AUTO_INCREMENT NOT NULL, substances LONGTEXT NOT NULL COMMENT \'(DC2Type:array)\', user_email VARCHAR(255) NOT NULL, user_first_name VARCHAR(255) DEFAULT NULL, user_sur_name VARCHAR(255) DEFAULT NULL, original_uuid VARCHAR(255) NOT NULL, destination_uuid VARCHAR(255) NOT NULL, representative_name VARCHAR(255) NOT NULL, representative_email VARCHAR(255) NOT NULL, representative_position VARCHAR(255) NOT NULL, file_name VARCHAR(255) DEFAULT NULL, file_path VARCHAR(255) DEFAULT NULL, file_mime_type VARCHAR(255) DEFAULT NULL, file_size INT DEFAULT NULL, file_timestamp DATETIME DEFAULT NULL COMMENT \'(DC2Type:carbondatetime)\', PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci ENGINE = InnoDB');
$this->addSql('ALTER TABLE substance_definition ADD in_transfer TINYINT(1) DEFAULT NULL, CHANGE cease_of_manufacturer_ts cease_of_manufacturer_ts DATETIME DEFAULT NULL COMMENT \'(DC2Type:carbondatetime)\', CHANGE created_at created_at DATETIME NOT NULL COMMENT \'(DC2Type:carbondatetime)\', CHANGE updated_at updated_at DATETIME NOT NULL COMMENT \'(DC2Type:carbondatetime)\', CHANGE tonnage_band_proof_timestamp tonnage_band_proof_timestamp DATETIME DEFAULT NULL COMMENT \'(DC2Type:carbondatetime)\', CHANGE tonnage_band_proof_approved_at tonnage_band_proof_approved_at DATETIME DEFAULT NULL COMMENT \'(DC2Type:carbondatetime)\'');
$this->addSql('ALTER TABLE legal_entity_contract ADD amendment_id INT DEFAULT NULL, ADD destination TINYINT(1) DEFAULT NULL, CHANGE acceptance_notification_sent acceptance_notification_sent DATE DEFAULT NULL COMMENT \'(DC2Type:carbondate)\', CHANGE accepted_at accepted_at DATETIME DEFAULT NULL COMMENT \'(DC2Type:carbondatetime)\', CHANGE created_at created_at DATETIME NOT NULL COMMENT \'(DC2Type:carbondatetime)\', CHANGE updated_at updated_at DATETIME NOT NULL COMMENT \'(DC2Type:carbondatetime)\', CHANGE check_date check_date DATE DEFAULT NULL COMMENT \'(DC2Type:carbondate)\', CHANGE file_timestamp file_timestamp DATETIME DEFAULT NULL COMMENT \'(DC2Type:carbondatetime)\'');
$this->addSql('ALTER TABLE legal_entity_contract ADD CONSTRAINT FK_465E8544DAB577D FOREIGN KEY (amendment_id) REFERENCES legal_entity_contract (id)');
$this->addSql('CREATE INDEX IDX_465E8544DAB577D ON legal_entity_contract (amendment_id)');
$this->addSql('ALTER TABLE legal_entity_staff_request ADD new_legal_entity_id INT DEFAULT NULL, ADD invoice_id INT DEFAULT NULL, ADD substances LONGTEXT DEFAULT NULL COMMENT \'(DC2Type:array)\', ADD original_uuid VARCHAR(255) DEFAULT NULL, ADD destination_uuid VARCHAR(255) DEFAULT NULL, ADD representative_name VARCHAR(255) DEFAULT NULL, ADD representative_email VARCHAR(255) DEFAULT NULL, ADD representative_position VARCHAR(255) DEFAULT NULL, ADD file_name VARCHAR(255) DEFAULT NULL, ADD file_path VARCHAR(255) DEFAULT NULL, ADD file_mime_type VARCHAR(255) DEFAULT NULL, ADD file_size INT DEFAULT NULL, ADD file_timestamp DATETIME DEFAULT NULL COMMENT \'(DC2Type:carbondatetime)\', CHANGE handled_at handled_at DATETIME DEFAULT NULL COMMENT \'(DC2Type:carbondatetime)\', CHANGE created_at created_at DATETIME NOT NULL COMMENT \'(DC2Type:carbondatetime)\', CHANGE updated_at updated_at DATETIME NOT NULL COMMENT \'(DC2Type:carbondatetime)\', CHANGE assigned_at assigned_at DATETIME DEFAULT NULL COMMENT \'(DC2Type:carbondatetime)\'');
$this->addSql('ALTER TABLE legal_entity_staff_request ADD CONSTRAINT FK_A6596A499E62B0FF FOREIGN KEY (new_legal_entity_id) REFERENCES legal_entity (id)');
$this->addSql('ALTER TABLE legal_entity_staff_request ADD CONSTRAINT FK_A6596A492989F1FD FOREIGN KEY (invoice_id) REFERENCES legal_entity_order_invoice (id)');
$this->addSql('CREATE INDEX IDX_A6596A499E62B0FF ON legal_entity_staff_request (new_legal_entity_id)');
$this->addSql('CREATE INDEX IDX_A6596A492989F1FD ON legal_entity_staff_request (invoice_id)');
}
public function down(Schema $schema): void
{
// this down() migration is auto-generated, please modify it to your needs
$this->abortIf('mysql' !== $this->connection->getDatabasePlatform()->getName(), 'Migration can only be executed safely on \'mysql\'.');
$this->addSql('DROP TABLE legal_entity_transfer');
$this->addSql('ALTER TABLE legal_entity_contract DROP FOREIGN KEY FK_465E8544DAB577D');
$this->addSql('DROP INDEX IDX_465E8544DAB577D ON legal_entity_contract');
$this->addSql('ALTER TABLE legal_entity_contract DROP amendment_id, DROP destination, CHANGE acceptance_notification_sent acceptance_notification_sent DATE DEFAULT NULL COMMENT \'(DC2Type:carbondate)\', CHANGE accepted_at accepted_at DATETIME DEFAULT NULL COMMENT \'(DC2Type:carbondatetime)\', CHANGE created_at created_at DATETIME NOT NULL COMMENT \'(DC2Type:carbondatetime)\', CHANGE updated_at updated_at DATETIME NOT NULL COMMENT \'(DC2Type:carbondatetime)\', CHANGE file_timestamp file_timestamp DATETIME DEFAULT NULL COMMENT \'(DC2Type:carbondatetime)\', CHANGE check_date check_date DATE DEFAULT NULL COMMENT \'(DC2Type:carbondate)\'');
$this->addSql('ALTER TABLE legal_entity_staff_request DROP FOREIGN KEY FK_A6596A499E62B0FF');
$this->addSql('ALTER TABLE legal_entity_staff_request DROP FOREIGN KEY FK_A6596A492989F1FD');
$this->addSql('DROP INDEX IDX_A6596A499E62B0FF ON legal_entity_staff_request');
$this->addSql('DROP INDEX IDX_A6596A492989F1FD ON legal_entity_staff_request');
$this->addSql('ALTER TABLE legal_entity_staff_request DROP new_legal_entity_id, DROP invoice_id, DROP substances, DROP original_uuid, DROP destination_uuid, DROP representative_name, DROP representative_email, DROP representative_position, DROP file_name, DROP file_path, DROP file_mime_type, DROP file_size, DROP file_timestamp, CHANGE handled_at handled_at DATETIME DEFAULT NULL COMMENT \'(DC2Type:carbondatetime)\', CHANGE assigned_at assigned_at DATETIME DEFAULT NULL COMMENT \'(DC2Type:carbondatetime)\', CHANGE created_at created_at DATETIME NOT NULL COMMENT \'(DC2Type:carbondatetime)\', CHANGE updated_at updated_at DATETIME NOT NULL COMMENT \'(DC2Type:carbondatetime)\'');
$this->addSql('ALTER TABLE substance_definition DROP in_transfer, CHANGE cease_of_manufacturer_ts cease_of_manufacturer_ts DATETIME DEFAULT NULL COMMENT \'(DC2Type:carbondatetime)\', CHANGE created_at created_at DATETIME NOT NULL COMMENT \'(DC2Type:carbondatetime)\', CHANGE updated_at updated_at DATETIME NOT NULL COMMENT \'(DC2Type:carbondatetime)\', CHANGE tonnage_band_proof_approved_at tonnage_band_proof_approved_at DATETIME DEFAULT NULL COMMENT \'(DC2Type:carbondatetime)\', CHANGE tonnage_band_proof_timestamp tonnage_band_proof_timestamp DATETIME DEFAULT NULL COMMENT \'(DC2Type:carbondatetime)\'');
}
}