vendor/boldr/receipt-printer-bundle/migrations/Version1_4_0.php line 1

Open in your IDE?
  1. <?php
  2. declare(strict_types=1);
  3. namespace Boldr\Shop\ReceiptPrinterBundle\Migrations;
  4. use Boldr\Cms\CmsBundle\BoldrCmsMigration;
  5. use Doctrine\DBAL\Schema\Schema;
  6. final class Version1_4_0 extends BoldrCmsMigration
  7. {
  8.     public function getBundle(): string { return 'boldr/receipt-printer-bundle'; }
  9.     public function getVersion(): string { return '1.4.0'; }
  10.     public function up(Schema $schema): void
  11.     {
  12.         // this up() migration is auto-generated, please modify it to your needs
  13.         $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;');
  14.         $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;');
  15.         $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;');
  16.     }
  17. }