<?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 Version20210917170105 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->abortIf($this->connection->getDatabasePlatform()->getName() !== 'mysql', 'Migration can only be executed safely on \'mysql\'.');
$this->addSql('ALTER TABLE claim DROP FOREIGN KEY FK_A769DE2754B763AD');
$this->addSql('DROP TABLE claimtype');
$this->addSql('DROP INDEX IDX_A769DE2754B763AD ON claim');
$this->addSql('ALTER TABLE claim ADD type VARCHAR(100) NOT NULL, DROP claim_type_id, CHANGE created_at created_at DATETIME NOT NULL, CHANGE updated_at updated_at DATETIME NOT NULL');
$this->addSql('UPDATE claim SET type="claim.products"');
}
public function down(Schema $schema) : void
{
// this down() migration is auto-generated, please modify it to your needs
$this->abortIf($this->connection->getDatabasePlatform()->getName() !== 'mysql', 'Migration can only be executed safely on \'mysql\'.');
$this->addSql('CREATE TABLE claimtype (id INT AUTO_INCREMENT NOT NULL, name VARCHAR(100) CHARACTER SET utf8 NOT NULL COLLATE `utf8_unicode_ci`, display TINYINT(1) NOT NULL, PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8 COLLATE `utf8_unicode_ci` ENGINE = InnoDB COMMENT = \'\' ');
$this->addSql('ALTER TABLE claim ADD claim_type_id INT DEFAULT NULL, DROP type, CHANGE created_at created_at DATETIME DEFAULT NULL, CHANGE updated_at updated_at DATETIME DEFAULT NULL');
$this->addSql('ALTER TABLE claim ADD CONSTRAINT FK_A769DE2754B763AD FOREIGN KEY (claim_type_id) REFERENCES claimtype (id)');
$this->addSql('CREATE INDEX IDX_A769DE2754B763AD ON claim (claim_type_id)');
}
public function isTransactional(): bool
{
return false;
}
}