app/DoctrineMigrations/Version20260213140000.php line 1

Open in your IDE?
  1. <?php declare(strict_types=1);
  2. namespace DoctrineMigrations;
  3. use Doctrine\DBAL\Schema\Schema;
  4. use Doctrine\Migrations\AbstractMigration;
  5. final class Version20260213140000 extends AbstractMigration
  6. {
  7.     public function getDescription(): string
  8.     {
  9.         return 'スライダーにカスタムURL・別タブ設定カラムを追加';
  10.     }
  11.     public function up(Schema $schema): void
  12.     {
  13.         $this->addSql("ALTER TABLE dtb_slider ADD COLUMN url VARCHAR(1024) DEFAULT NULL AFTER category_id");
  14.         $this->addSql("ALTER TABLE dtb_slider ADD COLUMN target_blank TINYINT(1) NOT NULL DEFAULT 0 AFTER url");
  15.     }
  16.     public function down(Schema $schema): void
  17.     {
  18.         $this->addSql("ALTER TABLE dtb_slider DROP COLUMN target_blank");
  19.         $this->addSql("ALTER TABLE dtb_slider DROP COLUMN url");
  20.     }
  21. }