app/DoctrineMigrations/Version20241210000000.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. final class Version20241210000000 extends AbstractMigration
  7. {
  8.    public function getDescription(): string
  9.    {
  10.        return 'Import maker data test';
  11.    }
  12.    public function up(Schema $schema): void
  13.    {
  14.        // DAHONのテストデータを挿入
  15.        $this->addSql(
  16.            'INSERT INTO dtb_maker (id, name_en, name_jp, create_date, update_date, discriminator_type) 
  17.            VALUES (5, \'DAHON\', \'ダホン\', NOW(), NOW(), \'maker\')'
  18.        );
  19.    }
  20.    public function down(Schema $schema): void
  21.    {
  22.        $this->addSql('DELETE FROM dtb_maker WHERE id = 5');
  23.    }
  24. }