app/DoctrineMigrations/Version20250101110550.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 Version20250101110550 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.         // update mtb_sale_type
  19.         $this->addSql("
  20.             UPDATE `mtb_sale_type` SET `name` = '通常商品' WHERE (`id` = '1');
  21.             UPDATE `mtb_sale_type` SET `name` = 'ダウンロード商品' WHERE (`id` = '2');
  22.             INSERT INTO `mtb_sale_type` (`id`, `name`, `sort_no`, `discriminator_type`) VALUES ('3', 'ポイント使用不可商品', '2', 'saletype');
  23.             INSERT INTO `mtb_sale_type` (`id`, `name`, `sort_no`, `discriminator_type`) VALUES ('4', '名入れ商品', '3', 'saletype');
  24.             INSERT INTO `mtb_sale_type` (`id`, `name`, `sort_no`, `discriminator_type`) VALUES ('99', '商品グループ', '4', 'saletype');
  25.         ");
  26.     }
  27.     public function down(Schema $schema): void
  28.     {
  29.         // this down() migration is auto-generated, please modify it to your needs
  30.         $this->addSql("
  31.             UPDATE `mtb_sale_type` SET `name` = '販売種別A' WHERE (`id` = '1');
  32.             UPDATE `mtb_sale_type` SET `name` = '販売種別B' WHERE (`id` = '2');
  33.             DELETE FROM `mtb_sale_type` WHERE (`id` = '3');
  34.             DELETE FROM `mtb_sale_type` WHERE (`id` = '4');
  35.             DELETE FROM `mtb_sale_type` WHERE (`id` = '99');
  36.         ");
  37.         $this->addSql("");
  38.     }
  39. }