<?php
declare(strict_types=1);
namespace DoctrineMigrations;
use Doctrine\DBAL\Schema\Schema;
use Doctrine\Migrations\AbstractMigration;
use Doctrine\DBAL\Schema\SchemaException;
/**
* Auto-generated Migration: Please modify to your needs!
*/
final class Version20190101000000 extends AbstractMigration
{
public function getDescription(): string
{
return '';
}
public function up(Schema $schema): void
{
try
{
$schema->getTable('migration_versions');
$oldMigrations = true;
}
catch (SchemaException $e)
{
$oldMigrations = false;
}
if ($oldMigrations)
{
$this->addSql("INSERT INTO doctrine_migration_versions (version, executed_at, execution_time) SELECT concat('DoctrineMigrations\\\\Version', version), executed_at, 1 FROM migration_versions;");
$this->addSql("DROP TABLE migration_versions;");
}
}
public function down(Schema $schema): void
{
// this down() migration is auto-generated, please modify it to your needs
}
}