migrations/Version20201202111519.php line 1

Open in your IDE?
  1. <?php
  2. declare(strict_types=1);
  3. namespace Application\Migrations;
  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 Version20201202111519 extends AbstractMigration
  10. {
  11.     public function up(Schema $schema): void
  12.     {
  13.         // this up() migration is auto-generated, please modify it to your needs
  14.         $this->abortIf('mysql' !== $this->connection->getDatabasePlatform()->getName(), 'Migration can only be executed safely on \'mysql\'.');
  15.         $this->addSql('ALTER TABLE substance_definition ADD tonnage_band_proof_tonnage_invoice_id INT 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)\', CHANGE tonnage_changed tonnage_changed TINYINT(1) NOT NULL, CHANGE amendment_id tonnage_band_proof_amendment_id INT DEFAULT NULL');
  16.     }
  17.     public function down(Schema $schema): void
  18.     {
  19.         // this down() migration is auto-generated, please modify it to your needs
  20.         $this->abortIf('mysql' !== $this->connection->getDatabasePlatform()->getName(), 'Migration can only be executed safely on \'mysql\'.');
  21.         $this->addSql('ALTER TABLE substance_definition ADD amendment_id INT DEFAULT NULL, DROP tonnage_band_proof_amendment_id, DROP tonnage_band_proof_tonnage_invoice_id, CHANGE tonnage_changed tonnage_changed 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_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)\'');
  22.     }
  23. }