<?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 Version20240615204253 extends AbstractMigration
{
const pages = [
[
'name' => 'サイトマップ',
'url' => 'help_sitemap',
'file' => 'Help/sitemap',
],
[
'name' => 'よくある質問',
'url' => 'help_qa',
'file' => 'Help/qa',
],
];
public function up(Schema $schema): void
{
foreach (self::pages as $page) {
$this->addSql("UPDATE dtb_page_layout SET discriminator_type = 'pagelayout' WHERE page_id = (
SELECT id FROM dtb_page WHERE url = '$page[url]'
)");
}
}
public function down(Schema $schema): void
{
foreach (self::pages as $page) {
$this->addSql("UPDATE dtb_page_layout SET discriminator_type = 'page_layout' WHERE page_id = (
SELECT id FROM dtb_page WHERE url = '$page[url]'
)");
}
}
}