app/DoctrineMigrations/Version20250322011512.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 Version20250322011512 extends AbstractMigration
  10. {
  11.     public function getDescription(): string
  12.     {
  13.         return '';
  14.     }
  15.     const NAME 'dtb_banner';
  16.     public function up(Schema $schema): void
  17.     {
  18.         // this up() migration is auto-generated, please modify it to your needs
  19.         if ($schema->hasTable(self::NAME)) {
  20.             return;
  21.         }
  22.         $this->addSql("CREATE TABLE dtb_banner (
  23.                                 id SMALLINT unsigned NOT NULL AUTO_INCREMENT, 
  24.                                 status BOOLEAN DEFAULT TRUE,
  25.                                 url VARCHAR(255) NULL DEFAULT NULL, 
  26.                                 link_method SMALLINT(5) NULL DEFAULT NULL,
  27.                                 image VARCHAR(255) NULL DEFAULT NULL, 
  28.                                 type TINYINT(5) NULL DEFAULT NULL,
  29.                                 sort_no SMALLINT(5) NULL DEFAULT NULL,
  30.                                 create_date datetime NOT NULL COMMENT '(DC2Type:datetimetz)',
  31.                                 update_date datetime NOT NULL COMMENT '(DC2Type:datetimetz)',
  32.                                 discriminator_type VARCHAR(255) NOT NULL, 
  33.                                 PRIMARY KEY(id)
  34.                             ) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8;
  35.                         ");
  36.         $this->addSql("INSERT INTO dtb_block (device_type_id, block_name, file_name, use_controller, deletable, create_date, update_date, discriminator_type) VALUES ('10', 'トピックバナー', 'content_topic_banner', '0', '0', NOW(), NOW(), 'block')");
  37.     }
  38.     public function down(Schema $schema): void
  39.     {
  40.         // this down() migration is auto-generated, please modify it to your needs
  41.         $this->addSql('DROP TABLE dtb_banner');
  42.     }
  43. }