Really skip migrations that are not needed.

This commit is contained in:
Jan Böhmer 2020-07-06 21:10:34 +02:00
parent bc885decf5
commit 7c16ee299b
2 changed files with 6 additions and 2 deletions

View file

@ -37,8 +37,11 @@ final class Version1 extends AbstractMultiPlatformMigration
public function mySQLUp(Schema $schema): void
{
$this->warnIf($this->getOldDBVersion() > 0, 'Old Part-DB Database detected! Continue with upgrade...');
//Skip if old DB is detected
if ($this->getOldDBVersion() > 0) {
$this->warnIf(true, 'Old Part-DB Database detected! Continue with upgrade...');
return;
}
// this up() migration is auto-generated, please modify it to your needs
$this->abortIf('mysql' !== $this->connection->getDatabasePlatform()->getName(), 'Migration can only be executed safely on \'mysql\'.');

View file

@ -48,6 +48,7 @@ final class Version20190902140506 extends AbstractMultiPlatformMigration
} catch (DBALException $dBALException) {
//when the table was not found, then you can not use this migration
$this->warnIf(true, 'Empty database detected. Skip migration.');
return;
}
//Deactive SQL Modes (especially NO_ZERO_DATE, which prevents updating)