migrations/Version20220506113218.php line 1

Open in your IDE?
  1. <?php
  2. /* @noinspection PhpUnused */
  3. declare(strict_types=1);
  4. namespace DoctrineMigrations;
  5. use Doctrine\DBAL\Schema\Schema;
  6. use Doctrine\Migrations\AbstractMigration;
  7. use Symfony\Component\Intl\Countries;
  8. /**
  9.  * Auto-generated Migration: Please modify to your needs!
  10.  *
  11.  * @package API
  12.  * @internal
  13.  */
  14. final class Version20220506113218 extends AbstractMigration
  15. {
  16.     public function down(Schema $schema): void
  17.     {
  18.         // this down() migration is auto-generated, please modify it to your needs
  19.     }
  20.     public function getDescription(): string
  21.     {
  22.         return
  23.             "- Seeding of country table.";
  24.     }
  25.     public function up(Schema $schema): void
  26.     {
  27.         // this up() migration is auto-generated, please modify it to your needs
  28.         $list '(\'' implode('\'),(\''Countries::getCountryCodes()) . '\');';
  29.         $this->addSql(
  30.             "
  31.                 INSERT INTO country
  32.                     (id)
  33.                 VALUES
  34.                     $list
  35.             "
  36.         );
  37.     }
  38. }