<?php
declare(strict_types=1);
namespace Boldr\Shop\ShopBundle\Migrations;
use Doctrine\DBAL\Schema\Schema;
use Boldr\Cms\CmsBundle\BoldrCmsMigration;
final class Version1_15_0 extends BoldrCmsMigration
{
public function getBundle(): string { return 'boldr/shop-bundle'; }
public function getVersion(): ?string { return '1.15.0'; }
public function up(Schema $schema): void
{
$this->addSql('ALTER TABLE order_number RENAME TO shop_order_number');
$this->addSql('ALTER TABLE shop_order_number CHANGE order_number order_number INT(11) NOT NULL');
$this->addSql('TRUNCATE shop_order_number');
$this->addSql('INSERT INTO shop_order_number (order_number) SELECT distinct `number` FROM shop_order WHERE `number` IS NOT NULL');
}
}