app/DoctrineMigrations/Version20250908120050.php line 1

Open in your IDE?
  1. <?php
  2. declare(strict_types=1);
  3. namespace DoctrineMigrations;
  4. use Doctrine\DBAL\Schema\Schema;
  5. use Doctrine\Migrations\AbstractMigration;
  6. /**
  7.  * Auto-generated Migration: Please modify to your needs!
  8.  */
  9. final class Version20250908120050 extends AbstractMigration
  10. {
  11.     public function getDescription(): string
  12.     {
  13.         return '';
  14.     }
  15.     public function up(Schema $schema): void
  16.     {
  17.         // this up() migration is auto-generated, please modify it to your needs
  18.         $count $this->connection->fetchOne("SELECT COUNT(*) FROM dtb_page WHERE url = 'products_apply_sticker_cutting'");
  19.         if ($count 0) {
  20.             return;
  21.         }
  22.         $pageId $this->connection->fetchOne('SELECT MAX(id) FROM dtb_page');
  23.         $sortNo $this->connection->fetchOne('SELECT MAX(sort_no) FROM dtb_page_layout');
  24.         // ApplyStickerCutting
  25.         $pageId++;
  26.         $this->addSql("INSERT INTO dtb_page (
  27.             id, master_page_id, page_name, url, file_name, edit_type, create_date, update_date, meta_robots, discriminator_type
  28.         ) VALUES(
  29.             $pageId, NULL, 'ApplyStickerCutting', 'products_apply_sticker_cutting', 'Product/apply_sticker_cutting', 2, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, 'page'
  30.         )");
  31.         $sortNo++;
  32.         $this->addSql("INSERT INTO dtb_page_layout (page_id, layout_id, sort_no, discriminator_type) VALUES ($pageId, 2, $sortNo, 'pagelayout')");
  33.     }
  34.     public function down(Schema $schema): void
  35.     {
  36.         // this down() migration is auto-generated, please modify it to your needs
  37.     }
  38. }