<?php
declare(strict_types=1);
namespace Boldr\Shop\ReceiptPrinterBundle\Migrations;
use Boldr\Cms\CmsBundle\BoldrCmsMigration;
use Doctrine\DBAL\Schema\Schema;
final class Version1_4_0 extends BoldrCmsMigration
{
public function getBundle(): string { return 'boldr/receipt-printer-bundle'; }
public function getVersion(): string { return '1.4.0'; }
public function up(Schema $schema): void
{
// this up() migration is auto-generated, please modify it to your needs
$this->addSql('CREATE TABLE shop_receipt_printer_only_containing_category (printer_id INT UNSIGNED NOT NULL, category_id INT UNSIGNED NOT NULL, INDEX IDX_82BA0CA646EC494A (printer_id), INDEX IDX_82BA0CA612469DE2 (category_id), PRIMARY KEY(printer_id, category_id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB;');
$this->addSql('ALTER TABLE shop_receipt_printer_only_containing_category ADD CONSTRAINT FK_82BA0CA646EC494A FOREIGN KEY (printer_id) REFERENCES shop_receipt_printer (id) ON DELETE CASCADE;');
$this->addSql('ALTER TABLE shop_receipt_printer_only_containing_category ADD CONSTRAINT FK_82BA0CA612469DE2 FOREIGN KEY (category_id) REFERENCES shop_category (id) ON DELETE CASCADE;');
}
}