app/DoctrineMigrations/Version20260305132549.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 Version20260305132549 extends AbstractMigration
  10. {
  11.     public function getDescription(): string
  12.     {
  13.         return '';
  14.     }
  15.     public function up(Schema $schema): void
  16.     {
  17.         // Template 1000: 注文キャンセルメール
  18.         $exists1000 $this->connection->fetchOne("SELECT count(*) FROM dtb_mail_template WHERE id = 1000");
  19.         if ($exists1000 == 0) {
  20.             $this->addSql("
  21.                 INSERT INTO dtb_mail_template (id, creator_id, name, file_name, mail_subject, footer, create_date, update_date, discriminator_type)
  22.                 VALUES (1000, null, '注文キャンセル受付メール', 'Mail/order_cancel.twig', 'ご注文キャンセルのご連絡', '■お問い合わせ -----------------------------------------------------------
  23. ご不明な点がございましたら、お気軽にお問い合わせください。
  24. 【ワードレコーズ・ダイレクト】
  25. [販売業者] 株式会社ワードレコーズ
  26. [URL] http://wardrecords.com
  27. [E-Mail] shopmaster@wardrecords.com
  28. ※土日祝祭日にいただいたメールでのお問い合わせの返信は翌営業日となります。', NOW(), NOW(), 'mailtemplate');");
  29.         }
  30.         // Template 1001: 出荷通知メール (通常)
  31.         $exists1001 $this->connection->fetchOne("SELECT count(*) FROM dtb_mail_template WHERE id = 1001");
  32.         if ($exists1001 == 0) {
  33.             $this->addSql("
  34.                 INSERT INTO dtb_mail_template (id, creator_id, name, file_name, mail_subject, create_date, update_date, discriminator_type)
  35.                 VALUES (1001, null, '出荷通知メール(クレジットカード)', 'Mail/shipping_notify_standard.twig', '商品発送のお知らせ', NOW(), NOW(), 'mailtemplate');");
  36.         }
  37.         // Template 1002: 出荷通知メール (GMO後払い)
  38.         $exists1002 $this->connection->fetchOne("SELECT count(*) FROM dtb_mail_template WHERE id = 1002");
  39.         if ($exists1002 == 0) {
  40.             $this->addSql("
  41.                 INSERT INTO dtb_mail_template (id, creator_id, name, file_name, mail_subject, create_date, update_date, discriminator_type)
  42.                 VALUES (1002, null, '出荷通知メール(後払い)', 'Mail/shipping_notify_gmo.twig', '商品発送のお知らせ', NOW(), NOW(), 'mailtemplate');");
  43.         }
  44.         // Template 1003: 出荷通知メール (代金引換)
  45.         $exists1003 $this->connection->fetchOne("SELECT count(*) FROM dtb_mail_template WHERE id = 1003");
  46.         if ($exists1003 == 0) {
  47.             $this->addSql("
  48.                 INSERT INTO dtb_mail_template (id, creator_id, name, file_name, mail_subject, create_date, update_date, discriminator_type)
  49.                 VALUES (1003, null, '出荷通知メール(代金引換)', 'Mail/shipping_notify_cod.twig', '商品発送のお知らせ', NOW(), NOW(), 'mailtemplate');");
  50.         }
  51.     }
  52.     public function down(Schema $schema): void
  53.     {
  54.         $this->addSql("DELETE FROM dtb_mail_template WHERE file_name IN ('Mail/order_cancel.twig', 'Mail/shipping_notify_standard.twig', 'Mail/shipping_notify_gmo.twig', 'Mail/shipping_notify_cod.twig');");
  55.     }
  56. }