app/DoctrineMigrations/Version20240826040824.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 Version20240826040824 extends AbstractMigration
  10. {
  11.     public function up(Schema $schema): void
  12.     {
  13.         $pageId $this->connection->fetchOne('SELECT MAX(id) FROM dtb_page');
  14.         $pageId++;
  15.         $this->addSql("INSERT INTO `dtb_page` (
  16.             `id`, `master_page_id`, `page_name`, `url`, `file_name`, `edit_type`, `create_date`, `update_date`, `meta_robots`, `discriminator_type`
  17.         ) VALUES(
  18.             $pageId, NULL, 'プリントステッカー見積/編集フォーム', 'product_estimate_print_sticker_edit', 'Product/Estimate/print_sticker_edit', 2, NOW(), NOW(), 'noindex', 'page'
  19.         )");
  20.         $sortNo $this->connection->fetchOne('SELECT MAX(sort_no) FROM dtb_page_layout');
  21.         $sortNo++;
  22.         $this->addSql("INSERT INTO dtb_page_layout (
  23.                              `page_id`, `layout_id`, `sort_no`, `discriminator_type`
  24.                              ) VALUES (
  25.                                        $pageId, 2, $sortNo, 'pagelayout')");
  26.         $pageId++;
  27.         $this->addSql("INSERT INTO `dtb_page` (
  28.             `id`, `master_page_id`, `page_name`, `url`, `file_name`, `edit_type`, `create_date`, `update_date`, `meta_robots`, `discriminator_type`
  29.         ) VALUES(
  30.             $pageId, NULL, 'カッティングステッカー見積/編集フォーム', 'product_estimate_cutting_sticker_edit', 'Product/Estimate/cutting_sticker_edit', 2, NOW(), NOW(), 'noindex', 'page'
  31.         )");
  32.         $sortNo++;
  33.         $this->addSql("INSERT INTO dtb_page_layout (
  34.                              `page_id`, `layout_id`, `sort_no`, `discriminator_type`
  35.                              ) VALUES (
  36.                                        $pageId, 2, $sortNo, 'pagelayout')");
  37.     }
  38.     public function down(Schema $schema): void
  39.     {
  40.         // this down() migration is auto-generated, please modify it to your needs
  41.     }
  42. }