app/DoctrineMigrations/Version20231026063710.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 Version20231026063710 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.         $sql 'SELECT `id` FROM `dtb_page` ORDER BY `id` DESC LIMIT 1';
  19.         $results $this->connection->fetchAssociative($sql);
  20.         $lastId = (int) $results["id"] + 1;
  21.         $insert_page "INSERT INTO dtb_page (id, page_name, url, file_name, edit_type, create_date, update_date, meta_robots, discriminator_type) VALUES ";
  22.         $insert_pagelayout "INSERT INTO dtb_page_layout (page_id, layout_id, discriminator_type) VALUES ";
  23.         $this->addSql($insert_page "($lastId ,'history_product_list', 'history_product_list', 'history_product_list', 1, '2023-10-26 17:06:17', '2023-10-26 17:06:17','noindex', 'page');");
  24.         $this->addSql($insert_pagelayout "($lastId ,2 ,'pagelayout');");
  25.     }
  26.     public function down(Schema $schema): void
  27.     {
  28.         // this down() migration is auto-generated, please modify it to your needs
  29.         $this->addSql('DELETE FROM dtb_page WHERE page_name = ?',["history_product_list"]);
  30.     }
  31. }