<?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 Version20190516031932 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 productForSaleComponents RENAME TO product_item');
$this->addSql('ALTER TABLE product_item CHANGE `idBaseProduct` `stock_item_id` INT(11)');
$this->addSql('ALTER TABLE product_item CHANGE `idProductForSale` `product_id` INT(11)');
$this->addSql('ALTER TABLE product_item RENAME INDEX idx_cbeadbbccdf9bda3 TO IDX_92F307BFBC942FD');
$this->addSql('ALTER TABLE product_item RENAME INDEX idx_cbeadbbce3696e8e TO IDX_92F307BF4584665A');
}
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 product_item RENAME INDEX idx_92f307bfbc942fd TO IDX_CBEADBBCCDF9BDA3');
$this->addSql('ALTER TABLE product_item RENAME INDEX idx_92f307bf4584665a TO IDX_CBEADBBCE3696E8E');
$this->addSql('ALTER TABLE product_item CHANGE `stock_item_id` `idBaseProduct` INT(11)');
$this->addSql('ALTER TABLE product_item CHANGE `product_id` `idProductForSale` INT(11)');
$this->addSql('ALTER TABLE product_item RENAME TO productForSaleComponents');
}
}