migrations/Version20190101000000.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. use Doctrine\DBAL\Schema\SchemaException;
  7. /**
  8.  * Auto-generated Migration: Please modify to your needs!
  9.  */
  10. final class Version20190101000000 extends AbstractMigration
  11. {
  12.     public function getDescription(): string
  13.     {
  14.         return '';
  15.     }
  16.     public function up(Schema $schema): void
  17.     {
  18.         try
  19.         {
  20.             $schema->getTable('migration_versions');
  21.             $oldMigrations true;
  22.         }
  23.         catch (SchemaException $e)
  24.         {
  25.             $oldMigrations false;
  26.         }
  27.         if ($oldMigrations)
  28.         {
  29.             $this->addSql("INSERT INTO doctrine_migration_versions (version, executed_at, execution_time) SELECT concat('DoctrineMigrations\\\\Version', version), executed_at, 1 FROM migration_versions;");
  30.             $this->addSql("DROP TABLE migration_versions;");
  31.         }
  32.     }
  33.     public function down(Schema $schema): void
  34.     {
  35.         // this down() migration is auto-generated, please modify it to your needs
  36.     }
  37. }