mirror of
https://github.com/Part-DB/Part-DB-server.git
synced 2025-06-21 09:35:49 +02:00
Really skip migrations that are not needed.
This commit is contained in:
parent
bc885decf5
commit
7c16ee299b
2 changed files with 6 additions and 2 deletions
|
@ -37,8 +37,11 @@ final class Version1 extends AbstractMultiPlatformMigration
|
||||||
|
|
||||||
public function mySQLUp(Schema $schema): void
|
public function mySQLUp(Schema $schema): void
|
||||||
{
|
{
|
||||||
|
//Skip if old DB is detected
|
||||||
$this->warnIf($this->getOldDBVersion() > 0, 'Old Part-DB Database detected! Continue with upgrade...');
|
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 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\'.');
|
$this->abortIf('mysql' !== $this->connection->getDatabasePlatform()->getName(), 'Migration can only be executed safely on \'mysql\'.');
|
||||||
|
|
|
@ -48,6 +48,7 @@ final class Version20190902140506 extends AbstractMultiPlatformMigration
|
||||||
} catch (DBALException $dBALException) {
|
} catch (DBALException $dBALException) {
|
||||||
//when the table was not found, then you can not use this migration
|
//when the table was not found, then you can not use this migration
|
||||||
$this->warnIf(true, 'Empty database detected. Skip migration.');
|
$this->warnIf(true, 'Empty database detected. Skip migration.');
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
//Deactive SQL Modes (especially NO_ZERO_DATE, which prevents updating)
|
//Deactive SQL Modes (especially NO_ZERO_DATE, which prevents updating)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue