<?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 Version20200803193143 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 cash_account_movement ADD operation_type VARCHAR(50) NOT NULL');
$this->addSql('UPDATE cash_account_movement SET operation_type="operation.sale" WHERE idOperation=6 OR idOperation=2');
$this->addSql('UPDATE cash_account_movement SET operation_type="operation.transfer" WHERE idOperation=1 OR idOperation=4 OR idOperation=5');
$this->addSql('UPDATE cash_account_movement SET operation_type="operation.expense" WHERE idOperation=3');
}
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('ALTER TABLE cash_account_movement DROP operation_type');
}
}