<?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 Version20201126152619 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('ALTER TABLE substance_definition ADD previous_tonnage_band INT NOT NULL, ADD tonnage_changed TINYINT(1) NOT 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)\'');
}
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('ALTER TABLE substance_definition DROP previous_tonnage_band, DROP tonnage_changed, 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)\'');
}
}