<?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 Version20240409084628 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
$exists = $this->connection->fetchOne("
SELECT count(*)
FROM dtb_temperature_control
WHERE name IN (
'常温商品', '冷蔵商品', '冷凍配送(冷蔵配送可)', '冷凍配送(冷凍配送のみ)'
)
");
if ($exists == 0) {
$this->addSql("
INSERT INTO dtb_temperature_control (
id, name, sort_no, discriminator_type
) VALUES
(null, '常温商品', 0, 'temperaturecontrol'),
(null, '冷蔵商品', 1, 'temperaturecontrol'),
(null, '冷凍配送(冷蔵配送可)', 2, 'temperaturecontrol'),
(null, '冷凍配送(冷凍配送のみ)', 3, 'temperaturecontrol')
;");
}
}
public function down(Schema $schema): void
{
// this down() migration is auto-generated, please modify it to your needs
}
}