<?php
declare(strict_types=1);
namespace DoctrineMigrations;
use Doctrine\DBAL\Schema\Schema;
use Doctrine\Migrations\AbstractMigration;
/**
* Auto-generated Migration: Please modify to your needs!
*/
final class Version20240221034120 extends AbstractMigration
{
public function getDescription(): string
{
return '';
}
public function up(Schema $schema): void
{
// this up() migration is auto-generated, please modify it to your needs
$sql = 'SELECT `id` FROM `dtb_page` ORDER BY `id` DESC LIMIT 1';
$results = $this->connection->fetchAssociative($sql);
$lastId = (int) $results["id"] + 1;
$insert_page = "INSERT INTO dtb_page (id, page_name, url, file_name, edit_type, create_date, update_date, meta_robots, discriminator_type) VALUES ";
$insert_pagelayout = "INSERT INTO dtb_page_layout (page_id, layout_id, discriminator_type) VALUES ";
$this->addSql($insert_page . "($lastId ,'About', 'about', 'about', 0, '2024-02-21 17:06:17', '2024-02-21 17:06:17','noindex', 'page');");
$this->addSql($insert_pagelayout . "($lastId ,2 ,'pagelayout');");
$lastId++;
$this->addSql($insert_page . "($lastId ,'Recruitment', 'recruit', 'recruit', 0, '2024-02-21 17:06:17', '2024-02-21 17:06:17','noindex', 'page');");
$this->addSql($insert_pagelayout . "($lastId ,2 ,'pagelayout');");
$lastId++;
$this->addSql($insert_page . "($lastId ,'Topics', 'topic', 'topic', 0, '2024-02-21 17:06:17', '2024-02-21 17:06:17','noindex', 'page');");
$this->addSql($insert_pagelayout . "($lastId ,2 ,'pagelayout');");
}
public function down(Schema $schema): void
{
// this down() migration is auto-generated, please modify it to your needs
}
}